admin管理员组文章数量:1379425
This leads on from my previous question.
I initialize a grid with a CheckBox Selection Model, however when I reconfigure the grid the Check Box Selection Model visaully dissapears.
What I want to do is dynamically add a CheckBox Selection Model to a grid after reconfiguring the grids columns, and visually display it.
I have tried something like this:
var sm = new Ext.selection.CheckboxModel();
grid.selModel = sm;
grid.doLayout();
This leads on from my previous question.
I initialize a grid with a CheckBox Selection Model, however when I reconfigure the grid the Check Box Selection Model visaully dissapears.
What I want to do is dynamically add a CheckBox Selection Model to a grid after reconfiguring the grids columns, and visually display it.
I have tried something like this:
var sm = new Ext.selection.CheckboxModel();
grid.selModel = sm;
grid.doLayout();
Share
Improve this question
edited May 23, 2017 at 12:23
CommunityBot
11 silver badge
asked Jun 20, 2011 at 10:42
shane87shane87
3,12013 gold badges52 silver badges66 bronze badges
2
- Hi shane87, did you find a solution for this issue? How did you solve that? – hienvd Commented Dec 21, 2015 at 3:16
- Hi @hienvd it seems that this was a bug which has been fixed according to Marc Abbey's answer below – shane87 Commented Dec 21, 2015 at 19:48
3 Answers
Reset to default 2This worked for me. SelectionModel dynamic flag
//dynamically change, true or false, as the case
selectionModel = true
var sm = {} // Selection Model
if (selectionModel){
sm = Ext.create('Ext.selection.CheckboxModel')
}
var grid = Ext.create('Ext.grid.Panel', {
selModel: sm,
frame: true,
store: store,
columns: columns,
// more code ....
})
If you are using ExtJS4, just do a grid.getSelectionModel()
after your reconfiguration and see if it works.
You don't have to do anything with the returned value. (if it doesn't work, debug to see what is returned by this method. is it an instance of CheckboxModel
?)
Note that this was a bug that has recently been patched:
http://www.sencha./forum/showthread.php?238825-Checkbox-disappears-after-reconfigure-call-on-locked-grid-with-checkbox-selection-mod
本文标签: javascriptHow to dynamically set the grids CheckBox Selection Model in ExtJs4Stack Overflow
版权声明:本文标题:javascript - How to dynamically set the grids CheckBox Selection Model in ExtJs4? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744441101a2606435.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论