View Full Version : [SOLVED] Adding Checkbox column in GridPanel via Ext Designer

2 Jun 2010, 11:22 AM
I know this is possible to do using Ext.grid.CheckboxSelectionModel but I could not figure out how to do it using the Ext Designer. A brief explanation and/or example would be greatly appreciated.

2 Jun 2010, 3:54 PM
Hello, Nightwish,

There may be a much better way to do this, but here's what I did that worked for me:

In Ext Designer I created a grid with a first column that I let default to what you get when you add a column
I removed the header and made the column width 20
Then after Exporting my design, I added the following lines of code to this js file that contains the initialization code for the component:

// My grid was within a viewport component, the grid had an autoref value of 'docGrid'
MyViewport = Ext.extend(MyViewportUi, {
initComponent: function() {

// Create a new checkbox column
var cm = new Ext.grid.CheckboxSelectionModel({
// Put additional config values and listeners here

// Replace the grid selection model
this.docGrid.selModel = cm;

// Replace the current first column in the grid with the checkbox column
this.docGrid.colModel.config[0] = cm;

I hope this helps, and if there's a better way to do this I'd be pleased to know.


3 Jun 2010, 5:38 AM
Yep, that's good Clyde. Here is another similar thread on the topic: http://www.extjs.com/forum/showthread.php?100197-Sublcass-configs

3 Jun 2010, 7:18 AM
Thank you both, that works beautifully! Clyde, you should be writing help manuals - that was exceptionally well explained down to the autoRef id which as a novice I did not know about.

3 Jun 2010, 10:24 AM
Thanks, Nightwish,

I'm really glad that worked for you.

Technical writing improves when your other job, like mine, is writing novels--psychological thrillers set along the Inside Passage! "Red Herring," "Precious Cargo," "Whiskey Gulf" the latest in the series.



3 Jun 2010, 12:12 PM
A programming novelist! That's one I've yet to hear...very cool :-)


6 Jul 2010, 5:14 PM
Using this exemple works ok. But, if I select all rows and after select just one. the top checkbox keep checked as such as selection model were all selected. How do I fix this? Thanks

6 Jul 2010, 7:07 PM
Hey Wemerson,

That may be a bug in the CheckboxSelectionModel. I will confirm or deny that for you in just a minute...


...Yes this is a bug in the CheckboxSelectionModel. Can you post this as a bug report on the Ext Bugs forum? Thanks Wemerson!

6 Jul 2010, 7:25 PM
posted! Thanks you.