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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can i sort grid according to specific column

Thread ID:





118525 Mar 17,2015 07:26 AM UTC Mar 20,2015 04:09 PM UTC JavaScript 4
Tags: ejGrid
Asked On March 17, 2015 07:26 AM UTC

please tell me about how can i get sorted record in grid according "todatvalue "
also tell about ascending and descending

<div id="Grid" ej-grid e-datasource="data1" e-toolbarsettings-showtoolbar='true' e-editsettings-addnewrow="bottom" e-toolbarsettings-toolbaritems='tools' e-editsettings-allowdeleting=' true'
                     e-editsettings-allowediting='true' e-editsettings-allowadding='true' e-allowpaging="true"   e-beginedit="disableedit"
                     e-editsettings-editmode='dialogtemplate' e-editsettings-inlineformtemplateid="#template" e-selectedrowindex="selectedRow" e-allowsorting="true" e-endedit="endedit" e-actioncomplete="complete">
                    <div e-columns>
                        <div e-column e-field="leave_id" e-headertext="Leave" e-isprimarykey="true" e-textalign="center"></div>
                        <div e-column e-field="fromdateValue" e-headertext="From Date" e-textalign="center" e-format="{0:dd-MMM-yyyy}"></div>
                        <div e-column e-field="todatevalue" e-headertext="To Date" e-textalign="center" e-format="{0:dd-MMM-yyyy}" e-allowsorting="true"></div>
                        <div e-column e-field="leave_days" e-headertext="Leave days" e-textalign="center"></div>
                        <div e-column e-field="reason" e-headertext="Reason" e-textalign="center"></div>
                        <div e-column e-field="status" e-headertext="Status" e-edittype="dropdownedit" e-datasource="leave_status" e-textalign="center"></div>

Replied On March 17, 2015 07:29 AM UTC

Please tell me solution in angular not in jquery

Balaji Marimuthu [Syncfusion]
Replied On March 18, 2015 12:23 PM UTC

Hi Gomtesh,

Thanks for using Syncfusion Products.

Query: please tell me about how can i get sorted record in grid according "todatvalue " also tell about ascending and descending. Please tell me solution in angular not in jquery

Do you want to get the Sorted Columns value such as if the “todate” column is sorted, then the sorted column value field “todate” and the direction is “ascending/ descending” or something else? Or you want to get the complete sorted grid records? Kindly explain the scenario more clearly. So that we could provide you with the solution.


Balaji Marimuthu

Replied On March 19, 2015 04:11 AM UTC

yes i have to get all grid record in according to todate value column in descending order but i perform operation on any record then descending order is not in grid if edit one record then also all grid records should according to todate value descending oder

Balaji Marimuthu [Syncfusion]
Replied On March 20, 2015 04:09 PM UTC

Hi Gomtesh,

Based on your requirement we have created the sample and the same can be downloaded from the following link.

Sample: Sample-118341.zip

<div id="Grid" ej-grid e-datasource="filtered>

. . . . . .



angular.module('listCtrl', ['ejangular'])

.controller('PhoneListCtrl', function ($scope, $compile,$filter) {

. . . . . .

$scope.filtered = $filter("orderBy")($scope.data1, "+to_date", true);



Your requirement is achieved by using the angular filter service in the Grid, and the sorting performed by the orderBy in angular. And the $scope.filtered record is binding to the Grid dataSource. We can get the sorted records by using the $scope.filtered.

Are you asking the mentioned behavior in your Grid or you need anyother requirement additionally, could you please provide more information regarding your requirement that will helpful to provide better solution ASAP.


Balaji Marimuthu


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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