PDA

View Full Version : GridPanel/PagingToolbar What's wrong with this code?



dougd_unc
11 Jul 2010, 8:31 PM
Hi,

I am creating a panel with a pagingtoolbar. For some reason in IE8, I get an error, deep in extjs 3.2.1. The code is obfuscated, so I can't tell what's going on. The only error I get is id is undefined. And this is about 8 levels up in the stack after the code below runs:




this.pendingProposedStore = Ext.ux.calendar.Mask.getEventStore(Ext.ux.calendar.CONST.pendingProposedURL);

var pbarp = new Ext.PagingToolbar({
pageSize: 20,
cls: 'aspPagingToolbar',
beforePageText: '',
store:this.pendingProposedStore
});

this.pendingProposedList = new Ext.grid.GridPanel({
border:false,
store:this.pendingProposedStore,
columns:pendingColumns,
view: new Ext.grid.GridView({
forceFit:true
}),
loadMask:{
msg:'Loading Pending Appointments'
},
anchor: '100% 100%',
bbar:pbarp
});

Any idea what could be causing this error?

Condor
11 Jul 2010, 9:46 PM
1. Use ext-all-debug.js for debugging (ext-all is minified, so it's useless for debugging).
2. I can't see anything wrong with the code you posted, but you are posting only a small fraction of your code (missing store config, columns config, data sample etc.).
3. Are you using JSON data? It is valid (try running it through jslint.com)?

dougd_unc
12 Jul 2010, 1:42 AM
Thanks for the tip!

This was the most ridiculous error I have seen in a while... :) Anyway the problem was in code I hadn't listed:


var pendingColumns = [
{header: 'Time', dataIndex:'ymd', width: 50, renderer:this.pendingDateRenderFn.createDelegate(this)},
{header: 'Name', width: 50, dataIndex:'name' /*, renderer:this.subjectRenderFn */},
];

pendingColumns.length was 3 because of the extra comma. 8-|