Hy,
Starting from this example:
http://www.smartclient.com/index.jsp#gridsDragReorder
I'm trying to make reorder permanent in my database.
This is my logic:
First, in my table I have an sortOrder field.
Now, when the user reorders the records I need to:
Get the record that it is moved (this is easy) and after that record is reordered I need to know which is the record that's before (a reference record).
After that I send both records ids via RPC to my server-side script.
On the server-side I modify sortOrder field for the reordered record using the sortOrder reference record. (In fact there'll be more than one sortOrder changed)
Back to client-side: I need to refetch the data with the same params (startRow,endRow etc.)
So what I need to know is:
1. which event is triggered when the reordered record is droped back in list grid - meanwhile I found it: ListGrid.recordDrop()
2. How can I find which is the record before the reordered record.
3. How I can refetch the data with the same params ( startRow, endRow, etc) ? - to be clear: I've noticed that the records does not really reorder (yeap it is written in the docs: "Note that reordering records has no effect on a databound grid.") - but still I'm not satisfied with that :))
To make it simple I'll use the example from gridsDragReorder:
When list grid is loaded the order is : US, China, Japan, India .
Let's say I want to move Japan after US:
2. How can I find what that the record that's before Japan (after reordering) is US ?
Thanks in advance,
John
Starting from this example:
http://www.smartclient.com/index.jsp#gridsDragReorder
I'm trying to make reorder permanent in my database.
This is my logic:
First, in my table I have an sortOrder field.
Now, when the user reorders the records I need to:
Get the record that it is moved (this is easy) and after that record is reordered I need to know which is the record that's before (a reference record).
After that I send both records ids via RPC to my server-side script.
On the server-side I modify sortOrder field for the reordered record using the sortOrder reference record. (In fact there'll be more than one sortOrder changed)
Back to client-side: I need to refetch the data with the same params (startRow,endRow etc.)
So what I need to know is:
1. which event is triggered when the reordered record is droped back in list grid - meanwhile I found it: ListGrid.recordDrop()
2. How can I find which is the record before the reordered record.
3. How I can refetch the data with the same params ( startRow, endRow, etc) ? - to be clear: I've noticed that the records does not really reorder (yeap it is written in the docs: "Note that reordering records has no effect on a databound grid.") - but still I'm not satisfied with that :))
To make it simple I'll use the example from gridsDragReorder:
When list grid is loaded the order is : US, China, Japan, India .
Let's say I want to move Japan after US:
2. How can I find what that the record that's before Japan (after reordering) is US ?
Thanks in advance,
John
Comment