We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get column order after reorder.

Thread ID:

Created:

Updated:

Platform:

Replies:

132624 Sep 12,2017 03:28 PM UTC Sep 13,2017 09:51 AM UTC JavaScript 1
loading
Tags: ejGrid
noName
Asked On September 12, 2017 05:17 PM UTC

I am using this event for column reorder:
columnDrop: function (args) { 
                        console.log(args);
                    },
I need column id, which I can get with args.column.id (because I add this property to the columns when Grid is created), but I need and new order/place of the column or all columns with new order, but in args there is nothing for that.
How to get and column order with Syncfusion Grid ?

Renjith Singh Rajendran [Syncfusion]
Replied On September 13, 2017 09:51 AM UTC

Hi Customer, 

Thanks for contacting Syncfusion support, 

We have analyzed your query. We have achieved your requirement by using the “actionComplete” event of Grid. Please refer the sample below 

$("#Grid").ejGrid({ 
             ... 
             ... 
             actionComplete: function (args) { 
                  if(args.requestType == "reorder") 
                  { 
                    for(i=0;i<args.model.columns.length;i++) 
                    { 
                       if(i + 1 != args.model.columns[i].id ) 
                       args.model.columns[i].id = i + 1 
                    } 
                  } 
             },  
             columns: [ 
                         { field: "OrderID",id:1, isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 90 }, 
                         ... 
                         ... 
                     ] 
            }); 
        }); 

We have also prepared a JSPlayground sample, please refer the sample below 

Please refer the documentation link below, 

Regards, 
Renjith Singh Rajendran. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;