问题
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.
Please suggest me.
回答1:
<script>
$(document).ready(function () {
$('#example1').DataTable({
aaSorting: [[0, "asc"]]
});
});
</script>
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 .
Thank you .
来源:https://stackoverflow.com/questions/39265301/sort-by-name-in-alphabetical-order-not-working-in-data-table