-
4 Jan 2012 2:23 AM #1
Answered: ERROR WITH CHECKOLUMN
Answered: ERROR WITH CHECKOLUMN
Hi,
I have a problem, with the "xtype": 'checkcolumn'. I can set a column in my grid, whose data index type is a boolean without problem, but when I try to set the column type to 'checkcolumn' I get this error:
Uncaught TypeError: Cannot call method 'substring' of undefined,
Can anybody tell m what's wrong, is it a bug ?
Thank's in avance
Regards
near
-
Best Answer Posted by skirtle
Using Ext.require will only help if you have the dynamic loader enabled and the UX files are in the right place.
You'd be better off just including it using a script tag. CheckColumn.js can be found in the ExtJS zip file you downloaded. It's in the directory examples/ux. It also needs a CSS file, CheckHeader.css, and the 2 images mentioned therein.
-
4 Jan 2012 5:51 AM #2
What I am using is this:
It renders an HTML checkbox in the grid cell.Code:{ header: 'Column header', dataIndex: 'booleanTypeFieldInStore', width: 135, renderer: function(value) { // This function converts true and false into checkbox checked or unchecked if(value == "0" || value == "false") value = false; else if(value == "1" || value == "true") value = true; return "<input type='checkbox' disabled='disabled'" + (value ? "checked='checked'" : "") + ">"; } }
-
4 Jan 2012 8:36 PM #3
CheckColumn isn't a part of the core library, it's a UX. That error means that you've forgotten to include the relevant JS file.
-
5 Jan 2012 1:56 AM #4
Hi Skirtle,
does the ext-all-debug.js include UX files ?
-
5 Jan 2012 2:06 AM #5
No. You may include it by putting it in Ext.require:
Code:Ext.require([ // any other things you use 'Ext.ux.CheckColumn' ]);
-
5 Jan 2012 2:20 AM #6
Using Ext.require will only help if you have the dynamic loader enabled and the UX files are in the right place.
You'd be better off just including it using a script tag. CheckColumn.js can be found in the ExtJS zip file you downloaded. It's in the directory examples/ux. It also needs a CSS file, CheckHeader.css, and the 2 images mentioned therein.
-
5 Jan 2012 2:33 AM #7
thank's guys ! it works !


Reply With Quote