3

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.

enter image description here

Please suggest me.

sradha
  • 2,216
  • 1
  • 28
  • 48

1 Answers1

2
<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 .

sradha
  • 2,216
  • 1
  • 28
  • 48