PDA

View Full Version : [3.2.x,3.3] Ext.ux.grid.MultiSort (Handle MultiSorting of Grids within a window)



makana
10 Aug 2010, 1:07 PM
Sure, MultiSorting of Grids is in examples (http://dev.sencha.com/deploy/dev/examples/grid/multiple-sorting.html). But sometimes, you don't have a whole toolbar for sorting. So I decided to manage it in a separate window.
Extract the archive directly into examples folder and open multisort.html to see how it is done.
Tested in FF3.6, IE8, Opera10.5 and Chromium6.0 on Windows.

To have it in German, use:


Ext.ns('Ext.ux.grid');

if (Ext.ux.grid.SortGridPanel) {
Ext.override(Ext.ux.grid.SortGridPanel, {
buttonCfg: {
up: {
text: 'Nach oben'
},
down: {
text: 'Nach unten'
},
asc: {
text: 'Aufsteigend sortieren'
},
desc: {
text: 'Absteigend sortieren'
}
},
columnText: 'Spalte'
});
}
if (Ext.ux.grid.SortWindow) {
Ext.override(Ext.ux.grid.SortWindow, {
buttonCfg: {
cancel: {
text: 'Abbrechen'
},
ok: {
text: 'OK'
}
},
title: 'Sortierung'
});
}
if (Ext.ux.grid.SortButton) {
Ext.override(Ext.ux.grid.SortButton, {
text: 'Sortierung'
});
}

JoeyRamone
1 Apr 2011, 10:13 AM
Awesome! You've made my day.

tdikarim
28 Sep 2011, 3:22 AM
Hi makana,

Thanks for your sharing.

I just modify the function sortStore to prevent an error from occurring if no selection was made and the user click the OK button


sortStore: function() {
>> if (this.getSorters().length > 0){
this.grid.getStore().multiSort(this.getSorters(), 'ASC');
>> }
this.hide();
}