PDA

View Full Version : checkColumn is not defined [Break On This Error] (150 out of range 11)



parsbin
1 Mar 2012, 12:03 AM
Hi
when i wanted to include a checkColumn in my grid, i`v receive an error in console:
checkColumn is not defined


chrome://firebug/content/blank.gif

(150 out of range 11)


i included ux/CheckColumn.js in my page.
my codes:


var store_dev = new Ext.data.GroupingStore({
url: 'php_cores/device/device_core.php?do=sub_device&devid='+devid,
autoLoad: true,
listeners: {
'load': function(store, records, options){
}
}
,
reader: new Ext.data.JsonReader({
root: "root",
totalProperty: 'totalCount'
},[
{name: "name", mapping:"name" },
{name: "validation", mapping:"validation" },
{name: "address" , mapping:"address" },
{name: "format" , mapping:"format" },
{name: "scale" , mapping:"scale" },
{name: "decimal" , mapping:"decimal" },
{name: "mask" , mapping:"mask" },
{name: "value", mapping:"value" },
{name: "groupname", mapping:"groupname" },
{name: "sign_of_record", mapping:"sign_of_record" }
])
,sortInfo:{field: 'groupname', direction: "ASC"},
groupField: 'groupname',
groupOnSort:false,
remoteGroup: false

});
store_dev.load();

var content_from_php_o = new Ext.grid.EditorGridPanel({
name: 'content_from_php_o',
id: 'content_from_php_o',
plugins:[checkColumn ],
clicksToEdit: 1,
store: store_dev,
height: 550 ,
autoScroll:true,
loadMask: {msg: 'Loading...'},
border: false,
cm: new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [
{id:'name',header: "Name", width: 140, dataIndex: 'name'},
{id:'validation',header: "Validation", width: 50, dataIndex: 'validation'},
{id:'address',header: "Address", width: 50, dataIndex: 'address'},
{id:'format',header: "Format", width: 70, dataIndex: 'format'},
{id:'scale',header: "Scale", width: 50, dataIndex: 'scale'},
{id:'decimal',header: "Decimal", width: 40, dataIndex: 'decimal'},
{id:'mask',header: "Mask", width: 50, dataIndex: 'mask'},
{id:'value',header: "Value", width: 80, dataIndex: 'value'},
{id:'groupname',header: "groupname",dataIndex: 'groupname',hidden: true}
,{
xtype: 'checkcolumn',
header: 'Indoor?',
width: 55
}
]
}),
view: new Ext.grid.GroupingView({
forceFit:true,
startCollapsed: true,
groupTextTpl: '{[ values.rs[0].data["groupname"] ? values.rs[0].data["groupname"] : "Add Group"]}'
}) ,
layout: 'fit'
});
new Ext.Panel({
height: 600 ,
border: true,
items:[
content_from_php_o
]
});

mitchellsimoens
1 Mar 2012, 5:08 AM
In your code it says 'checkcolumn' but the error is saying 'checkColumn'

parsbin
1 Mar 2012, 8:20 AM
i think this error s related to "plugins:[checkColumn ],"

mitchellsimoens
1 Mar 2012, 8:33 AM
i think this error s related to "plugins:[checkColumn ],"

I skipped right over that. CheckColumn isn't a plugin, it's a column so you don't need to put it in the plugins.

parsbin
2 Mar 2012, 12:11 AM
i`v removed plugin but i received an other error
"g is not a constructor"


var store_dev = new Ext.data.GroupingStore({
url: 'php_cores/device/device_core.php?do=sub_device&devid='+devid,
autoLoad: true,
listeners: {
'load': function(store, records, options){
}
}
,
reader: new Ext.data.JsonReader({
root: "root",
totalProperty: 'totalCount'
},[
{name: "name", mapping:"name" },
{name: "validation", mapping:"validation" },
{name: "address" , mapping:"address" },
{name: "format" , mapping:"format" },
{name: "scale" , mapping:"scale" },
{name: "decimal" , mapping:"decimal" },
{name: "mask" , mapping:"mask" },
{name: "value", mapping:"value" },
{name: "groupname", mapping:"groupname" },
{name: "sign_of_record", mapping:"sign_of_record" }
])
,sortInfo:{field: 'groupname', direction: "ASC"},
groupField: 'groupname',
groupOnSort:false,
remoteGroup: false

});
store_dev.load();

var content_from_php_o = new Ext.grid.EditorGridPanel({
name: 'content_from_php_o',
id: 'content_from_php_o',

clicksToEdit: 1,
store: store_dev,
height: 550 ,
autoScroll:true,
loadMask: {msg: 'Loading...'},
border: false,
cm: new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [
{id:'name',header: "Name", width: 140, dataIndex: 'name'},
{id:'validation',header: "Validation", width: 50, dataIndex: 'validation'},
{id:'address',header: "Address", width: 50, dataIndex: 'address'},
{id:'format',header: "Format", width: 70, dataIndex: 'format'},
{id:'scale',header: "Scale", width: 50, dataIndex: 'scale'},
{id:'decimal',header: "Decimal", width: 40, dataIndex: 'decimal'},
{id:'mask',header: "Mask", width: 50, dataIndex: 'mask'},
{id:'value',header: "Value", width: 80, dataIndex: 'value'},
{id:'groupname',header: "groupname",dataIndex: 'groupname',hidden: true}
,{
xtype: 'checkcolumn',
header: 'Indoor?',
width: 55
}
]
}),
view: new Ext.grid.GroupingView({
forceFit:true,
startCollapsed: true,
groupTextTpl: '{[ values.rs[0].data["groupname"] ? values.rs[0].data["groupname"] : "Add Group"]}'
}) ,
layout: 'fit'
});
new Ext.Panel({
height: 600 ,
border: true,
items:[
content_from_php_o
]
});

parsbin
2 Mar 2012, 2:37 AM
my problem has been solved by :


{id:'tick',header: "tick", width: 80, dataIndex: 'tick'
,editor : new Ext.form.Checkbox({
allowBlank : false,
listeners:{
'check': function(){
console.log(this.getValue());
this.setRawValue('111');
}
}
})
},

but i want show checkbox as value in the column in grid.
in now, checkbox just showed for edit times.how can do it?

parsbin
2 Mar 2012, 10:11 PM
not idea?