PDA

View Full Version : Very wierd 'glitch' I can't explain...



madirishman
18 Nov 2009, 10:40 AM
This is very strange, and I can't explain it. It's happening in my column model. I get an error in firebug (with no additional info) on the line with 'Month_5'. BUT if I put 1 blank line right above it, it will run just fine!

this breaks:


//create colModel for reasource grid
this.resourceColModel = new Ext.grid.ColumnModel({
columns: [
{header: "Layout ID", dataIndex: 'LAYOUTUID', hidden: true},
{header: "Resouce Name", dataIndex: 'RESOURCENAME', id:'resourceCol',
width: 150,
summaryType: 'count',
summaryRenderer: function(v, params, data){
return ('Project ManPwr Dollars:');}
},
{header: "Cost Element", width: 150, dataIndex: 'COSTELEMENTNAME'},
{header: "Nov", summaryType: 'sum', dataIndex: 'MONTH_1', editor: this.editorMonth, editable: false, renderer:this.renderMonth},
{header: "Dec", summaryType: 'sum', dataIndex: 'MONTH_2', editor: this.editorMonth},
{header: "Jan", summaryType: 'sum', dataIndex: 'MONTH_3', editor: this.editorMonth},
{header: "Feb", summaryType: 'sum', dataIndex: 'MONTH_4', editor: this.editorMonth},
{header: "Mar", summaryType: 'sum', dataIndex: 'MONTH_5', editor: this.editorMonth},
{header: "Apr", summaryType: 'sum', dataIndex: 'MONTH_6', editor: this.editorMonth},
{header: "May", summaryType: 'sum', dataIndex: 'MONTH_7', editor: this.editorMonth},
{header: "Jun", summaryType: 'sum', dataIndex: 'MONTH_8', editor: this.editorMonth},
{header: "Jul", summaryType: 'sum', dataIndex: 'MONTH_9', editor: this.editorMonth},
{header: "Aug", summaryType: 'sum', dataIndex: 'MONTH_10', editor: this.editorMonth},
{header: "Sep", summaryType: 'sum', dataIndex: 'MONTH_11', editor: this.editorMonth},
{header: "Oct", summaryType: 'sum', dataIndex: 'MONTH_12', editor: this.editorMonth},
{header: "Total",
align: 'center',
summaryType: 'sum',
renderer: function(v, params, record){
return (record.data.MONTH_1*10000 + record.data.MONTH_2*10000 + record.data.MONTH_3*10000 + record.data.MONTH_4*10000 + record.data.MONTH_5*10000 + record.data.MONTH_6*10000 + record.data.MONTH_7*10000 + record.data.MONTH_8*10000 + record.data.MONTH_9*10000 + record.data.MONTH_10*10000 + record.data.MONTH_11*10000 + record.data.MONTH_12*10000)/10000;}
}],
defaults: {
sortable: false,
menuDisabled: true,
width: 50
}
});

This works:


//create colModel for reasource grid
this.resourceColModel = new Ext.grid.ColumnModel({
columns: [
{header: "Layout ID", dataIndex: 'LAYOUTUID', hidden: true},
{header: "Resouce Name", dataIndex: 'RESOURCENAME', id:'resourceCol',
width: 150,
summaryType: 'count',
summaryRenderer: function(v, params, data){
return ('Project ManPwr Dollars:');}
},
{header: "Cost Element", width: 150, dataIndex: 'COSTELEMENTNAME'},
{header: "Nov", summaryType: 'sum', dataIndex: 'MONTH_1', editor: this.editorMonth, editable: false, renderer:this.renderMonth},
{header: "Dec", summaryType: 'sum', dataIndex: 'MONTH_2', editor: this.editorMonth},
{header: "Jan", summaryType: 'sum', dataIndex: 'MONTH_3', editor: this.editorMonth},
{header: "Feb", summaryType: 'sum', dataIndex: 'MONTH_4', editor: this.editorMonth},

{header: "Mar", summaryType: 'sum', dataIndex: 'MONTH_5', editor: this.editorMonth},
{header: "Apr", summaryType: 'sum', dataIndex: 'MONTH_6', editor: this.editorMonth},
{header: "May", summaryType: 'sum', dataIndex: 'MONTH_7', editor: this.editorMonth},
{header: "Jun", summaryType: 'sum', dataIndex: 'MONTH_8', editor: this.editorMonth},
{header: "Jul", summaryType: 'sum', dataIndex: 'MONTH_9', editor: this.editorMonth},
{header: "Aug", summaryType: 'sum', dataIndex: 'MONTH_10', editor: this.editorMonth},
{header: "Sep", summaryType: 'sum', dataIndex: 'MONTH_11', editor: this.editorMonth},
{header: "Oct", summaryType: 'sum', dataIndex: 'MONTH_12', editor: this.editorMonth},
{header: "Total",
align: 'center',
summaryType: 'sum',
renderer: function(v, params, record){
return (record.data.MONTH_1*10000 + record.data.MONTH_2*10000 + record.data.MONTH_3*10000 + record.data.MONTH_4*10000 + record.data.MONTH_5*10000 + record.data.MONTH_6*10000 + record.data.MONTH_7*10000 + record.data.MONTH_8*10000 + record.data.MONTH_9*10000 + record.data.MONTH_10*10000 + record.data.MONTH_11*10000 + record.data.MONTH_12*10000)/10000;}
}],
defaults: {
sortable: false,
menuDisabled: true,
width: 50
}
});

what the heck??:-?

Animal
18 Nov 2009, 11:09 AM
"an error" isn't much for us to go on!

aw1zard2
18 Nov 2009, 11:22 AM
Trim your MONTH_4 line it has extra chars behind it.

madirishman
18 Nov 2009, 11:42 AM
Wow, that was it - extra lines! Good catch!

aw1zard2
18 Nov 2009, 11:44 AM
Highlight text is your friend!
:D