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. Image for the cookie policy date
close icon

Disable sorting on a MVC ejGrid


  $("#order_grid").ejGrid({
                        dataSource: ej.DataManager({ url: "GetAllocation?param_ot=" + Order_Type + "&param_pc=" + itemcode, batchUrl: "UpdateAllocationHSIP", adaptor: "UrlAdaptor" }),
                      allowGrouping: false,
                      editSettings: { allowDeleting: true, allowEditing: true, allowAdding: true, editMode: 'batch' },
                        allowScrolling: true,
                        scrollSettings: { width: "100%", height: "auto" },
                        allowPaging: false,
                        enableAltRow: true,
                        showColumnChooser: true,
                        allowSorting: false,
                        allowTextWrap: true,
                        textWrapSettings: { wrapMode: "both" },
                        allowResizeToFit: true,
                        showStackedHeader: true,
                        isResponsive: true,
                        enableResponsiveRow: true,
                        allowScrolling: true,
                        allowFiltering: true,
                        filterSettings: {
                            filterType: "excel"
                        }, 
                        create: "create",
                        cellSave: "cellSave",
                   
                        actionComplete: "successSave",
                        actionFailure: "failure",
                  
                        columns: [
                        
                            { field: "OrderNumber", headerText: "Order No.", visible: true, allowEditing: false, isPrimaryKey: true, width: 160 },
                            { field: "Facility", headerText: "Facility", visible: true, allowEditing: false, width: 100 },
                       
                            { field: "DatePrepared", headerText: "Date Prepared", visible: true, allowEditing: false, width: 90 , format: "{0:dd/MMM/yyyy}" },
                           
                            { field: "DrugCode", headerText: "Product Code", allowEditing: false, width: 70, isPrimaryKey: true },
                          
                          

Hello there, 

Above is my code for a JS grid and i want to disable sorting automatically on that grid, i have  tried using  "allowSorting: false  but its not working it keeps on sorting the records on the grid in ascending order, 


Please Advise!

Many Thanks 


Simon


1 Reply

VN Vignesh Natarajan Syncfusion Team April 1, 2019 05:34 AM UTC

Hi Simon, 
 
Thanks for using Syncfusion products. 
 
Query: “i want to disable sorting automatically on that grid, i have  tried using  "allowSorting: false  but its not working it keeps on sorting the records on the grid in ascending order 
 
From your query, we understand that you are facing issue with sorting feature in ejGrid. We have prepared a sample using your code example and we are not able to reproduce the reported issue at our end. From your code example we found that you are using UrlAdaptor, actions like filtering, sorting etc will be handled in the server side. So reported issue may occur when it is not handled properly in the serverside.  
 
Kindly refer the below link for the sample prepared using 17.1.0.38 version. 
 
 
Kindly share the following details to reproduce the reported issue at our end, 
 
  1. Share the Grid rendering code (server side).
  2. Share the video demonstration of reported issue and also share the details how the data is returned from server.
  3. Share your essential studio version (xx.x.x.xx)
  4. If possible share the issue reproducible sample or try to reproduce the reported issue in provided sample.
 
Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon