Datatable sorting

Hi
I want to sort the datatable values. Normal sorting method will sort only those column values on which user has clicked on, but if those values are same then i want to sort on the basis of their adjacent column . Any idea how to do that.Is webix provide any out of box functionality for that.

You can create a custom sorting function which will use values from many columns

http://docs.webix.com/datatable__sorting.html#customsortingfunctions

Thanks maksim i got that…

Hi maksim, In
function sortById(a,b){
a = a.rank;
b = b.rank;
return a>b?1:(a<b?-1:0);
}
This will bring the value of two rows i.e a & b for current column. But now let’s say a.rank===b.rank , in this case i want to check the next column property. I know a and b contains every property of the grid, but how i can get exactly right side column name.(dynamically).

For Eg:
c1 | c2 | c3|

a |d | c |

a |b |e |

In this as column c1 value is same for two rows then sorting should happen taking consideration of column c2. Please give me one eg, how i can do that?

The sorting function receives only data object, it doesn’t receive info about a column for which sorting was triggered.