PDA

View Full Version : grid setSortable modern



LizMyself
12 Jun 2020, 5:08 AM
Hey together,

I want to change the sortable attribute of my grid by a userinteraction, but it is not working. A refresh also dosen't help.
What do I have to do that the buttons work?

https://fiddle.sencha.com/#view/editor&fiddle/36ko (https://fiddle.sencha.com/#view/editor&fiddle/36ko)

Thanks for your help!

ArthurRubens
14 Jun 2020, 1:22 PM
Looks like to be bug, but you can do the following:



...
items: [{
docked: 'top',
items: [{
xtype: 'button',
height: 30,
width: 200,
text: 'Disable sorter',
handler: function () {
var grid = this.up("grid");
grid.getHeaderContainer().setSortable(false);
}
}, {
xtype: 'button',
height: 30,
width: 200,
text: 'Enable sorter',
handler: function () {
var grid = this.up("grid");
grid.getHeaderContainer().setSortable(true);
}
}]
}]
...

LizMyself
14 Jun 2020, 11:58 PM
Thank you that is the solution I was hoping for! I would never have found this solution myself!