-
15 Jul 2010 4:15 PM #1
[FIXED-186] Not Including CheckboxSelectionModel In Column Model
[FIXED-186] Not Including CheckboxSelectionModel In Column Model
When adding a CheckboxSelectionModel to a grid it looks fine in the designer, but when the exported project is run in the browser the checkbox column is missing because it's not being included in the column model.
I appreciate that this can't be done using entirely declarative syntax as you need two references (selModel and a column) to the same selection model, so the exported .ui.js code would need to declare the column model before the main object and then reference it in the declaration.
Currently I'm having to add the code below to the corresponding .js file after initialization, which is hardly a major pain, more a minor irritation.
Code:this.MyGrid.colModel.config.unshift(this.MyGrid.selModel);
-
15 Jul 2010 7:25 PM #2Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
That's actually not true, the selModel is included in the exported code. It is identical to the code you see generated in the Code->Class tab:
This has been the case since version 1.0.2.1, released a week ago.Code:/* * File: MyGrid.ui.js * Date: Thu Jul 15 2010 23:22:55 GMT-0400 (EDT) * * This file was generated by Ext Designer version xds-1.0.2.5. * http://www.extjs.com/products/designer/ * * This file will be auto-generated each and everytime you export. * * Do NOT hand edit this file. */ MyGridUi = Ext.extend(Ext.grid.GridPanel, { title: 'My Grid', width: 400, height: 250, initComponent: function() { this.selModel = new Ext.grid.CheckboxSelectionModel({ }); this.columns = [ this.selModel, { xtype: 'gridcolumn', dataIndex: 'string', header: 'Column', sortable: true, width: 100 }, { xtype: 'numbercolumn', dataIndex: 'number', header: 'Column', sortable: true, width: 100, align: 'right' }, { xtype: 'datecolumn', dataIndex: 'date', header: 'Column', sortable: true, width: 100 }, { xtype: 'booleancolumn', dataIndex: 'bool', header: 'Column', sortable: true, width: 100 } ]; MyGridUi.superclass.initComponent.call(this); } });
-
16 Jul 2010 1:00 AM #3
Definitely not working for me
Definitely not working for me
I'm running v1.0.2.5 and whilst the checkbox column does show correctly in the code preview, it's missing in the generated .ui.js file. I guess this explains why it appears up on the design surface but not the designer preview or the browser.
As I'm working on an old project which was created with v1.0.1, I've just created a new minimal project but it still doesn't work.
I've attached this quick test project which is missing things like a store etc., but you'll see that the problem is still there for me.
-
18 Jul 2010 9:17 PM #4Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
True enough, thanks ciw1973. As a workaround, you can do a "Promote to Class" on your GridPanel. When the GridPanel is a root component, the selModel will properly be added into the column model, as you see in my code segment above. It becomes quite tricky when the GridPanel is a JSON configured child item of some other component. I will figure out a solution to this however.
Thanks again!
-
22 Jul 2010 6:14 AM #5
When we add a checkbox SelModel, in designer appear to be ok. But when we test in the real application it does not appers.
Ok. if I add this
it works .Code:this.grid.colModel.config[0]= this.grid.selModel;
But the config on position[1] destroy. Why?
I am fixing this using this.
this.grid.colModel.config.unshift(this.grid.selModel);
is it the better Way?Last edited by wemerson.januario; 22 Jul 2010 at 6:16 AM. Reason: solution
Wemerson Januario
Skype: wemerson.januario
Email: wemerson.januario@gmail.com
Fone: 62 84101145 - Goiânia-GO- Brazil
Consulting and Training Ext JS
Projects: (Nubes ERP)
-
22 Jul 2010 6:19 AM #6Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
Yes use unshift(), it will append the selModel to the beginning of the colModel config instead of overwriting the first index.
If it isn't showing up in the real application, did you do what I suggested? That is, did you promote the GridPanel to a class of its own? If you do that, it will generate the proper code and work for you.
-
22 Jul 2010 3:18 PM #7Wemerson Januario
Skype: wemerson.januario
Email: wemerson.januario@gmail.com
Fone: 62 84101145 - Goiânia-GO- Brazil
Consulting and Training Ext JS
Projects: (Nubes ERP)
-
29 Jan 2011 2:33 AM #8
I have written a nicer work-around in the main (grid) class
Code:Sen.search.Grid = Ext.extend(Sen.search.GridUi, { initComponent: function () { Sen.search.GridUi.superclass.initComponent = Sen.search.GridUi.superclass.initComponent.createInterceptor(function () { this.columns.splice(0, 0, this.selModel); }, this); Sen.search.Grid.superclass.initComponent.call(this); } });Last edited by dotnetwise; 29 Jan 2011 at 2:34 AM. Reason: formatted code
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED-186] Documentation events for Ext.util.TapRepeater
By deister in forum Sencha Touch 1.x: BugsReplies: 1Last Post: 30 Jul 2010, 9:21 AM -
Ampersand in column model doesnt show in column header menulist?
By aolee in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 19 Apr 2010, 2:31 AM -
[FIXED][3.0.0] column model defaultSortable changed (no longer writable)
By mjlecomte in forum Ext 3.x: BugsReplies: 4Last Post: 21 Jul 2009, 8:39 AM -
Adding mouseover event to column in column model
By shameed in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 28 Jun 2009, 4:46 PM -
Wrong height in Column Panel including a TabPanel
By Dr.BuP in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 17 Jan 2008, 9:15 AM


Reply With Quote
