PDA

View Full Version : [FIXED-786][3.2-beta]Ext.data.Store -> multiSort



tobiu
24 Mar 2010, 4:23 PM
hi team,

it took me 2+ hours to debug this, so i hope its ok if i leave out the bug-template.

when using a gridPanel with a groupingStore + remoteSort, nothing happens when you click on a column to sort the grid on that. also nothing happens when clicking on the sort item inside the columnMenu.

so i looked into cloumnModel and all the other stuff first.

what actually happens is:



multiSort: function(sorters, direction) {
this.hasMultiSort = true;
direction = direction || "ASC";

//toggle sort direction
if (this.multiSortInfo && direction == this.multiSortInfo.direction) {
direction = direction.toggle("ASC", "DESC");
}


/**
* @property multiSortInfo
* @type Object
* Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
*/
this.multiSortInfo = {
sorters : sorters,
direction: direction
};

if (!this.remoteSort) {
this.applySort();
this.fireEvent('datachanged', this);
}
}


since this.remoteSort === true, nothing happens with no else part.


kind regards,
tobiu

tobiu
24 Mar 2010, 4:54 PM
for the column-sorting, i converted the multisort back to a singlesort, just taking the first entry over to the server. not the final solution i guess ;)



Ext.data.Store.override({
multiSort: function(sorters, direction) {
this.hasMultiSort = true;
direction = direction || "ASC";

//toggle sort direction
if (this.multiSortInfo && direction == this.multiSortInfo.direction) {
direction = direction.toggle("ASC", "DESC");
}

/**
* @property multiSortInfo
* @type Object
* Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
*/
this.multiSortInfo = {
sorters : sorters,
direction: direction
};

if (this.remoteSort) {
this.singleSort(sorters[0].field, sorters[0].direction);

} else {
this.applySort();
this.fireEvent('datachanged', this);
}

}
});


but since Ext.data.GroupingStore -> sort() returns


return this.multiSort.call(this, sorters, dir);


i see no better choice right now.


kind regards,
tobiu

steffenk
25 Mar 2010, 1:53 AM
Hi,

i can second the problem, but i don't think calling singleSort is the correct solution as it only sorts with the first parameter. This would deactivate multisort for remote stores. So there should be pushing the params and do the load for remote store.

steffenk
25 Mar 2010, 1:02 PM
btw - i think this bug is a real showstopper as sorting in GroupingStore with remote doesn't work at all, just to push it up.

Jamie Avins
25 Mar 2010, 1:06 PM
We are looking into it, should be fixed in svn shortly.

steffenk
25 Mar 2010, 1:51 PM
thx!

edspencer
30 Mar 2010, 9:38 AM
I've implemented tobiu's suggested change for now. This will make multisort drop back to single sort when using a remote data source. The alternative would have been to come up with a new set of params to be sent to the server, which I don't want to do without some discussion first.

edspencer
30 Mar 2010, 9:43 AM
The DataViewTransition ux was originally written to use small, local and fixed stores. This is an obvious limitation which needs to be overcome - we intend to do so in the next patch release.

tobiu
9 Feb 2011, 9:08 AM
Hi Ed,

if I remember your session from the Sencha Con right, this is coming with Ext 4.
Any chance to also include it into the 3.x branch?

Otherwise I would build a version for myself since we need this for our next release.


Best regards
Tobias

edspencer
9 Feb 2011, 12:51 PM
Hi Ed,

if I remember your session from the Sencha Con right, this is coming with Ext 4.
Any chance to also include it into the 3.x branch?

Otherwise I would build a version for myself since we need this for our next release.


Best regards
Tobias

Not sure exactly what you're referring to...

tobiu
9 Feb 2011, 1:31 PM
i thought i heared something about multisorting for grids at the conf. maybe i got it wrong, many sessions / talks and some time passed...

i guess i will take a closer look into this by myself during the next days.


best regards
tobias

edspencer
9 Feb 2011, 1:35 PM
Oh right - you mean baked into the UI? We have a prototype working but I'm not sure if it'll be in 4.0...