Viewing multiple rows using Multirow -- How to Sort?

Talk about implementation of multirow operations

Moderators: ne_moj, zewa

SFGolfer
Newbie
Newbie
Posts: 6
Joined: Feb 19th, '09, 04:13

Viewing multiple rows using Multirow -- How to Sort?

Postby SFGolfer » Feb 19th, '09, 04:30

When using the Multirow option to view multiple rows by selecting the checkboxes, the records appear sorted by their database ID# in ASC order which may not necessarily be the same order presented in the View mode. This may confuse the user.

Is there a way to set the sort order for multirow viewing?

Possible to use the field(s) specified in $default_order_field?

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Viewing multiple rows using Multirow -- How to Sort?

Postby administrator » Mar 20th, '09, 19:03

Yes the issue is fixed. You can fix it by yourself:

In method Bind() find

Code: Select all

                if(($this->layouts['view'] == "0") && ($this->layouts['edit'] == "1") && ($req_mode == "details")){
                    $this->rids = explode("-", $this->rid);
                    // if we have more that 1 row selected
                    if(count($this->rids) > 1){
                        $where = "WHERE ".$this->primary_key." IN ('-1' ";
                        foreach ($this->rids as $key){ if($key != "") $where .= ", '".$key."' "; }
                        $where .= ") ";
                        $this->multi_rows = count($this->rids);



After the last line add next line:

Code: Select all

if($sort_field != "") $this->sql_sort = " ORDER BY ".(($req_sort_field_type == "numeric") ? " ABS (".$sort_field.")" : $sort_field)." ".$req_sort_type;

tedibear
Newbie
Newbie
Posts: 1
Joined: Mar 2nd, '15, 09:03

Re: Viewing multiple rows using Multirow -- How to Sort?

Postby tedibear » Mar 2nd, '15, 09:06

We have wrote a custom multirow operation for updating multiple records, our default page size is 250, but having to scroll to the bottom when the majority will be select all and perform operation, can we move this to the top of the table? if so how?
Try out our free Testking ccna security cost and latest comptia training courses Testking ceh online training to get high flying success in final and www.northeastern.edu exams, mcts College of Notre Dame of Maryland is also very useful tool.

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Viewing multiple rows using Multirow -- How to Sort?

Postby administrator » Mar 2nd, '15, 18:17

You may place SetMultirowOperations() method of datagrid class at the top of table, do it via the code.


Return to “Settings: multirow operations”