Change the order in which rows are presented

QuestionsChange the order in which rows are presented
Santosh Sankhar asked 1 year ago

Hi Abu,

Currently I have a working master-detail pair of Grids. I’m wondering if I can implement something to let the user reorder the rows on the detail Grid, either by dragging the row to the preffered position, or by adding two buttons that move the selected row up or down. I guess the database will need a field to maintain the order, and i currently have that.

¿Is there any online demo that I can refer to? Thanks in advance.

1 Answers
Abu Ghufran Staff answered 1 year ago

Hello,

You can sort of the database field which stores listing order number.

And make 2 toolbar buttons to move up / move down. On click of those buttons, you need to implement a callback function that will increment or decrement the ordering in database.

For ref: https://www.gridphp.com/demo/demos/editing/bulk-edit.phps

131-133: register callback event
135: callback function
141-152: edit description button working
224-264: adding toolbar button

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

18 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?