Custom sorting function for variable columns
Custom sorting function for variable columns
![devWaleed](https://secure.gravatar.com/avatar/b8e90961e0aea9269cb601fa6a8f8f6c/?default=https%3A%2F%2Fvanillicon.com%2Fb8e90961e0aea9269cb601fa6a8f8f6c_200.png&rating=g&size=120)
Hello devs!
I am using DataTables by simply echoing all table in PHP as normal html and then initializing DataTables over it.
i.e : $('table').DataTable();
But I have some problem. I want to design a custom sorting function which is fine but I don't know how to define it since my number of columns are not always same. They maybe 3 first time, on page refresh they maybe 7 columns.
And I have to design a custom function because normal sorting doesn't work for my case. Have a look at the image.
Image: https://ibb.co/cZ4ZyG
I know how to create custom function, but I don't know how to use on variable columns.
Thanks.