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.

How can i sort grid according to specific column

Thread ID:

Created:

Updated:

Platform:

Replies:

118525 Mar 17,2015 03:26 AM Mar 20,2015 12:09 PM JavaScript 4
loading
Tags: ejGrid
Gomtesh
Asked On March 17, 2015 03:26 AM

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>
                    </div>
                </div>
        </div>

Gomtesh
Replied On March 17, 2015 03:29 AM

Please tell me solution in angular not in jquery

Balaji Marimuthu [Syncfusion]
Replied On March 18, 2015 08:23 AM

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.

Regards,

Balaji Marimuthu


Gomtesh
Replied On March 19, 2015 12:11 AM

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 12:09 PM




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>

. . . . . .

</div>

<script>

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

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

. . . . . .

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

});

</script>

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.

Regards,

Balaji Marimuthu


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.

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.

;