问题描述
这里我已经从控制器中获取了数据,一切都很好(根据字母顺序),但是在数据表中却没有我想要的东西,意味着在查看时按字母顺序.
Here i have fetched the data from controller , all are coming fine (according to the alphabetical order) ,but in data table its not coming what i want to get ,means in alphabetical order while viewing .
默认情况下,所有数据均按降序排列
Here all the data in descending order by default
aaSorting: [[0, "desc"]],
我需要根据名称字段按字母顺序对其进行排序
I need it to be sort according to the name field in alphabetical order
我附上了按扣,以进行进一步说明.在这里,我希望所有中心名称都应按字母顺序排列.
I have attached a snap for more clarification.Here i want all the center name should be in alphabetical order.
请建议我.
推荐答案
<script>
$(document).ready(function () {
$('#example1').DataTable({
aaSorting: [[0, "asc"]]
});
});
</script>
经过研究,终于知道了这一点.我只是在此页下面添加了此js代码.结果就来了,我需要什么.这可能对其他人有帮助.
After doing a research ,finally got to know this .i just added this js codes below of this page .And results came ,what i need.It may be helpful to anyone else .
谢谢.
这篇关于按字母顺序按名称排序在数据表中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!