Reputation: 2244
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.
Upvotes: 3
Views: 6806
Reputation: 2244
<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 .
Upvotes: 2