I get this error intermitently during the reload after editing a cell in my edit grid and after the commitChanges.
I'm baffled because I've got other grids working just fine and this one doesn't, and I can't find anything wrong. I've been coding ExtJS since December and have learned a lot about grids, but this one is a stumper.
I've read the forums, docs page, etc. I read the post entitled "K has no properties". I broke on all errors to inspect "this" in the DOM, but can't nail down the specific element/id in error. The field SITCD is in the FF debug list, but not sure if it's relevant; I checked its code and data and the look fine.
The difference between this grid and others that work fine are (not sure if these are causing the error):
1.) I've got a checkcolumn (that works fine on its own)
2.) A readonly date in m/d/y format.
I'm concerned as to why it happens intermitently; could this start happening to my other grids?
Here's the FF error:
K has no properties
GridView([Object name=SITID id=0 style=width:118px;display:none;, Object name=SITCS id=1 style=width:68px;display:none;, Object name=SITCD id=2 style=width:88px;, 4 more...], [undefined], Object data=[9] baseParams=Object paramNames=Object, -1, 7, true)ext-all.js (line 141)
GridView(-1, -1)ext-all.js (line 141)
GridView(Object data=[9] baseParams=Object paramNames=Object, -1, -1, true)ext-all.js (line 141)
GridView(Object id=9 data=Object json=Object store=Object dirty=true)ext-all.js (line 141)
GridView(Object data=[9] baseParams=Object paramNames=Object, Object id=9 data=Object json=Object store=Object dirty=true)ext-all.js (line 141)
Observable()ext-all.js (line 12)
Observable()ext-all.js (line 12)
Store(Object id=9 data=Object json=Object store=Object dirty=true)ext-all.js (line 43)
Record("SITCD", Tue Jun 03 2008 00:00:00 GMT-0500 (Central Daylight Time))ext-all.js (line 41)
initComponent(Object field=Object initialConfig=Object events=Object, Tue Jun 03 2008 00:00:00 GMT-0500 (Central Daylight Time), Wed Jun 03 1908 00:00:00 GMT-0500 (Central Daylight Time))
Here's relevant protions of the grid code:
the store:
{ name : 'SITID', type: 'string' , mapping: 'SITID' }
, { name : 'SITCS', type: 'int' , mapping: 'SITCS' } mindgames | puzzling you since 1980:: This solitaire card game has 52 cards laid out randomly in a 9x7 grid. Save and reload puzzles. See solution with pause or no-pause http://ihsan.biz/index.htmlHOME | Red States/Blue States:: The white spots in this image are elements with no material assigned to them) can also save and reload properties, skeleton and mesh construction information http://www.ctcms.nist.gov/~rlua/redblue/index.htmlHOME |
, { name : 'SITCD', type: 'date' , mapping: 'SITCD' }
, { name : 'SITCM', type: 'string' , sortable: false, mapping: 'SITCM' }
, { name : 'SITPI', type: 'string' , sortable: false, mapping: 'SITPI' }
, { name : 'SITCU', type: 'string' , mapping: 'SITCU' }
, { name : 'CMTDT', type: 'date' , mapping: 'CMTDT' }
the cm:
tcmColumnModel = new Ext.grid.ColumnModel(
[
{
header: 'Site#',
readOnly: true,
dataIndex: 'SITID',
width: 120,
hidden: true,
renderer: function(value,cell) {
cell.css = "readonlycell";
return value;
}
}
, {
header: 'Seq#',
readOnly: true,
dataIndex: 'SITCS',
width: 70,
hidden: true,
renderer: function(value,cell) {
cell.css = "readonlycell";
return value;
}
}
, {
header: 'Date',
readOnly: false,
dataIndex: 'SITCD',
width: 90,
hidden: false
, renderer: Ext.util.Format.dateRenderer('m/d/y'),
editor: new Ext.form.DateField({
format: 'm/d/y'
})
}
, {
header: 'Comment',
dataIndex: 'SITCM',
width: 360,
hidden: false
, editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 60
}),
renderer: function(value,cell,record,columnIndex) {
var user = record.get("SITCU");
// var user2 = record.data.SITCU;
if( user != Ext.get('usrpf').dom.value ){
cell.css = "readonlycell";
}
return value;
}
}
, SITPIcheckColumn // ** I've got the checkColumn coded; just didn't include it here , {
header: 'UpdatedBy',
readOnly: true,
dataIndex: 'SITCU',
width: 60,
hidden: false
, renderer: function(value,cell) {
cell.css = "readonlycell";
return value;
}
}
, {
header: 'Last Chged',
readOnly: true,
dataIndex: 'CMTDT',
width: 80,
hidden: false,
renderer: function(value,cell) {
cell.css = "readonlycell";
return value ? value.dateFormat('m/d/y') : '';
}
}
]
);
My grid has: plugins: SITPIcheckColumn for the checkcolumn.
I've found and read a bit on the DOM and how to debug errors, however if there's a more thorough explanation/tutorial on tracking down errors like these that would be a great help!
Thanks in advance!
Seems to me you could test this problem in something simple like the array grid in the demos or some simplified test situation.
there should be a circle (brownish) with that error. Click on it and it will set a breakpoint so that firebug stops before the error. Reload the page and step through. You'll have to figure out what 'r' is and what it should be. I'd load another grid that works without flaws and compare.
This is critical for us - if a grid does this randomly it can't be considered stable by our users. I need to find out how to resolve this.
I wish ext-all-debug.js offered more info; just saying "K has no properties" isn't sufficent. I've spent enough time on this without getting anywhere.
Any help would be appreciated.
Thanks.
Yes; that would work too.
I finally ofund the problem; my date coming in was "07/18/08" when it should be "07/18/2008". Once I changed the Reader date values it not longer threw that error.
Once again, thanks for your assitance; I greatly appreciate it! =D>
Don't know inspect what rs is in firebug. Compare it to a working version.
Still have the problem when you comment out your Date column?
Thanks for the prompt reply. You're right; I had taken out the debug file; I put it back in and now the error reads:
r has no properties
doRender([Object name=SITID id=0 style=width:118px;display:none;, Object name=SITCS id=1 style=width:68px;display:none;, Object name=SITCD id=2 style=width:88px;, 4 more...], [undefined], Object data=[9] baseParams=Object paramNames=Object, -1, 7, true)ext-all-debug.js (line 29840)
renderRows(-1, -1)
What does R stand for? It isn't more descriptive than K. What am I missing?
Is the list in ascending or descending sequence; in order words is doRender before or after renderRows? I'm trying to logically follow this to find out where the error is.
I'll look this over; but all of my data looks good both in the re-loaded store and the existing grid rows after editing.
Thanks.
It looks like it's my date field; SITCD. If I comment it out of the column model the error doesn't occur. So! How do you format the date?
From other examples I've got "07/14/08" coming from the server into the Reader. The Column Model date is defined/firmatted thusly:
{
header: 'Date',
readOnly: false,
dataIndex: 'SITCD',
width: 90,
hidden: false,
sortable: false,
editor: new Ext.form.DateField({
format: 'm/d/y'
}),
// renderer: Ext.util.Format.dateRenderer('m/d/y')
renderer: function(value,cell,record,columnIndex) {
var user = record.get("SITCU");
// var user2 = record.data.SITCU;
if( user != Ext.get('usrpf').dom.value ){ // If a different user don't allow editing
cell.css = "readonlycell";
}
return value ? value.dateFormat('m/d/y') : "";
}
}
I'm guessing the issue is the last line - return value ? value.dateFormat('m/d/y') : "";.
I've tried variations without success. If you have no date should it be "" (blanks) or "00/00/00" or null? Using "" works everywhere except for this error when reloading.
I'll keep plugging away...
Please try to summarize what the problem was, what symptoms there were, and what the solution was if you would. Based on that I'd try to add something to the FAQ. For example, this field rendered ok or did it not even work before?
It looks like R is rs from:
"doRender : function(cs, rs, ds, startRow, colCount, stripe)"
however I have no idea what rs is - is it "record selection"?
startRow is -1, which seems wrong; should it start at 0, then count up to each row in the datastore?
I'll keep looking.
You might want to post working code that reproduces problem.
K has no properties is suggestive of ext-all.js. Are you sure it's ext-all-debug that is throwing that error? Before you answer see the message below.
K has no properties
GridView([Object name=SITID id=0 style=width:118px;display:none;, Object name=SITCS id=1 style=width:68px;display:none;, Object name=SITCD id=2 style=width:88px;, 4 more...], [undefined], Object data=[9] baseParams=Object paramNames=Object, -1, 7, true)ext-all.js (line 141)
How much does getting a small tattoo on your hip/stomach hurt?
Do anyone else have an itchy anus? ?
|