PDA

View Full Version : Visually removing records in grid with dd reorder



Maarten76
9 Apr 2010, 1:09 AM
I'm trying to get the DD reorder plugin working for an EditorGridPanel. Most of it is working fine, but...

When I move a row this is done by the following (plugin) code:



if (!self.copy)
{
for (var i = 0; i < data.selections.length; i++)
{
ds.remove(ds.getById(data.selections[i].id));
}
}

for (var i = selections.length - 1; i >= 0; i--)
{
var insertIndex = rindex;
ds.insert(insertIndex, selections[i]);
}


By calling ds.remove and later inserting the ds.insert the row is visually moved, but..! ds.remove causes an ajax call so that the record is removed from the database and not only visually to perform the move effect.

How to fix this? Move the row without the ajax call being performed. Thinking about this almost 2 hours right now..

Animal
9 Apr 2010, 2:01 AM
Have you stepped into the ds.remove call and found out what it's doing?

Maarten76
9 Apr 2010, 2:07 AM
It's the grid store and it fires the remove event. Why do you ask? It's the documented remove function of a store?

Animal
9 Apr 2010, 2:35 AM
And did you step into the fireEvent call which fires "remove", and follow it into any listeners?

Maarten76
9 Apr 2010, 5:22 AM
I stepped through the ds.remove method and the functions fireing the events but I still can't find the solution. Can you please point me (a little bit more) in the right direction? Or anyone else?

Maarten76
11 Apr 2010, 5:05 AM
Anyone? I'm not able to find a solution!

Maarten76
12 Apr 2010, 4:11 PM
I still don't have the solution and spent to many hours on this. Someone have any solution?

Will it help to buy the extjs license so that extjs employees will answer my questions?