PDA

View Full Version : facing an error when using the 'checkcolumn' inside 'Ext.grid.Panel'



Ibrahimp
5 Jul 2012, 6:40 AM
Hi,

I facing an error when using the 'checkcolumn' inside columns :

var myGridPanel = Ext.create('Ext.grid.Panel', {
title: 'Permissions',
cm: selModel,
store: Ext.data.StoreManager.lookup('userStore'),
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Read', dataIndex: 'read' },
{ header: 'Write', dataIndex: 'write' },
{
xtype: 'checkcolumn',
header: 'write',
dataIndex: 'readwrite',
width: 60,
editor: {
xtype: 'checkbox'
}
}

],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

error in ext-all.js -
Microsoft JScript runtime error: Unable to get value of the property 'substring': object is null or undefined.

The store is defined as follows -

Ext.create('Ext.data.Store', {
storeId: 'userStore',
fields: [
{ name: 'name', type: 'string' },
{ name: 'Read', type: 'bool' },
{ name: 'Write', type: 'bool' },
{ name: 'readwrite', type: 'bool' }
],
data: { 'items': [
{ 'name': 'Lisa', "Read": "true", "Write": "true", "readwrite": "true" },
{ 'name': 'Bart', "Read": "true", "Write": "true", "readwrite": "true" },
{ 'name': 'Homer', "Read": "true", "Write": "true", "readwrite": "true" },
{ 'name': 'Marge', "Read": "true", "Write": "true", "readwrite": "true" }
]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Please help.

Thanks.


P.S - using <script src="extjs-4.1.0/ext-all.js" type="text/javascript"></script> .js library.

droessner
5 Jul 2012, 9:14 AM
CheckColumn is a plugin. You have to load this plugin before using it.

scottmartin
5 Jul 2012, 9:22 AM
As mentioned, this is a UX and has to be loaded prior to use:
Ext.require(['Ext.ux.CheckColumn']); // or included in your uses (html)

Scott.

Ibrahimp
5 Jul 2012, 10:57 PM
Thanks for your prompt reply.

but even after loading it doesn't work for me.

Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.ux': '../extjs-4.1.0/examples/ux'
}
});
Ext.require(['Ext.ux.CheckColumn']);

what else is missing?

Thanks,
Ib

Ibrahimp
5 Jul 2012, 11:29 PM
resolved it by including-

<script src="extjs-4.1.0/examples/ux/CheckColumn.js" type="text/javascript"></script>

Thanks.