按字母顺序按名称排序在数据表中不起作用 [英] Sort by name in alphabetical order not working in data table

查看:53
本文介绍了按字母顺序按名称排序在数据表中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我已经从控制器中获取了数据,一切都很好(根据字母顺序),但是在数据表中却没有我想要的东西,意味着在查看时按字母顺序.

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 .

谢谢.

这篇关于按字母顺序按名称排序在数据表中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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