嗨,Iam_Using_Gridview使用Jquerydatatable.Using Jquery.Datatables.Js,Jquery.Datatables.Min.Js.Now我无法排序Numericfield.I希望Numericfield Tobe排序Notonly Singlebutttontone数字 [英] Hi,Iam_Using_Gridview With Jquerydatatable.Using Jquery.Datatables.Js, Jquery.Datatables.Min.Js.Now I Unable Sort Numericfield.I Want Numericfield Tobe Sorted Notonly Singlebut Morethanone Digits

查看:91
本文介绍了嗨,Iam_Using_Gridview使用Jquerydatatable.Using Jquery.Datatables.Js,Jquery.Datatables.Min.Js.Now我无法排序Numericfield.I希望Numericfield Tobe排序Notonly Singlebutttontone数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Iam_using_GridView与jquerydatatable.using jquery.dataTables.js,jquery.dataTables.min.js.Now我无法对numericfield进行排序。我希望数字字段排序只是单个但是多个数字。

Hi,Iam_using_GridView with jquerydatatable.using jquery.dataTables.js, jquery.dataTables.min.js.Now i unable sort numericfield.I want numericfield tobe sorted notonly singlebut morethanone digits.

推荐答案

如果它为单个数字排序OK,而没有正确排序多个数字,那么通常是你的数据源。通常情况下,有人愚蠢地使用基于字符的存储(例如SQL中的VARCHAR或NVARCHAR)来存储数值 - 因此,排序是逐个字符而不是数字。这显示为这样的排序顺序:

If it's sorting OK for single digits, and not sorting correctly for multiple digits, it's normally down to your datasource. Generally what happens is that someone foolishly uses character based storage (such as VARCHAR or NVARCHAR in SQL) to store a numeric value - and as a result the sort is on a character by character basis, rather than numeric. This shows up as a sort order like this:
1
12
14
157
2
200
21

对此最好的解决方案是在数据源上修复问题,并使用适当的数据类型:INT或DECIMAL表示数字,DATETIME表示日期,等等。虽然通常有可能在这种情况下解决这个问题,但就问题引起的问题而言,它只是冰山一角!

The best solution to this is to fix the problem at the datasource, and use appropriate datatypes: INT or DECIMAL for numbers, DATETIME for dates, and so forth. While it is generally possible to get round this in this instance, it is just the tip of the iceberg as far as the problems it will cause are concerned!


这篇关于嗨,Iam_Using_Gridview使用Jquerydatatable.Using Jquery.Datatables.Js,Jquery.Datatables.Min.Js.Now我无法排序Numericfield.I希望Numericfield Tobe排序Notonly Singlebutttontone数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆