PDA

View Full Version : Sort after append



roman.buzuk
9 Jan 2013, 1:49 AM
How I can make sorting after appending nodes in drag-and-drop tree?

friend
9 Jan 2013, 5:11 AM
You can call sort (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.TreeStore-method-sort) on the underlying TreeStore (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.TreeStore).

Animal
9 Jan 2013, 2:10 PM
nodeAppendedTo.sort(nodeAppendedTo.getOwnerTree().store.generateComparator());

roman.buzuk
9 Jan 2013, 10:27 PM
nodeAppendedTo.sort(nodeAppendedTo.getOwnerTree().store.generateComparator());

I think, these are methods from 3.x, but I use 4.x.

You can call sort (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.TreeStore-method-sort) on the underlying TreeStore (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.TreeStore). Where should I call sort?
Give me some example, please.

I tried that way

listeners: {
drop:function(node,data,model,dropposition,options)
{
store.sort();
}

But after drop node on empty folder, folder is expanded,but child is not displayed. If I expands this folder again, child displayed.