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

Issues Sorting Numerically In Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

117421 Oct 16,2014 10:28 PM UTC Oct 21,2014 11:41 AM UTC JavaScript 3
loading
Tags: ejGrid
Mark Wells
Asked On October 16, 2014 10:28 PM UTC

I'm having issues with the sorting settings in the grid. we have an "Engine ID" column that ranges in numbers from 1 to 999999. Right now when we sort this column, it will only sort them according to the first value of the number—for example, if we sort them backwards it could look something like: 

Engine ID
945
70324
602
434345
2
10005

This is incredibly lame, so I need to know how to sort numerically according to the full number, not just the first value of the number.

Thanks!



Attachment: sortingscreenshots_54a4915.zip

Ragavee U S [Syncfusion]
Replied On October 17, 2014 12:53 PM UTC

Hi Mark

 

We have analyzed the reported query and we suspect that you have passed the values to the ENGINE ID column as string type and thus the sorting is performed based on the string values.

 

So we suggest you to bind the values to the column with type as integer in order to avoid the mentioned issue.

 

Please let us know if you have any queries.

 

Thanks and Regards,

Ragavee U S


Mark Wells
Replied On October 20, 2014 03:02 PM UTC

Could you provide links to some examples?

Ragavee U S [Syncfusion]
Replied On October 21, 2014 11:41 AM UTC

Hi Mark

 

Based on your requirement, we have created a simple sample and the same can be downloaded from the below location.

 

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/JS_Sample_12.2.0.361459213197.zip

 

In the above sample, we have passed values to the ID column as integer and NAME column as string. Please see the below snippet.

 

var Data = [];

        for (var i = 0; i < 100000; i += 1) {

            Data.push({ "ID": i, "Name": "column[1]" + "[" + i + "]", "City": "column[2]" + "[" + i + "]" });

        }       

 

For your kind information, from your query we have understood that you have requested for a sample to bind integer columns to dataSource. So we have provided a sample on the same.

 

Please get back to us if we have misunderstood your requirement by providing more information which will be helpful for us to provide response accordingly.

 

Please let us know if you have any concern.

 

Regards

Ragavee U S


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.

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

;