Sorting Issue in pivot Table

Hi,
Because of addition of search box in the pivot table columns the sort is not working or not available as seen in the below script.
If i comment the below line, then the sort symbol is popping up and able to sort
line no:45
// head[count].content = “customFilterName”;

https://snippet.webix.com/a4pktor4

Can you please help in addition of sort functionality with the above script

Can anyone please advise on the above query?

Hello @sangeetha,

Can you please help in addition of sort functionality with the above script

In your example every subheader is replaced with a custom filter object, which doesn’t register as a proper header. This essentially means that the innate ability to sort via a click on the header is gone. Fortunately, there are a few ways around this issue:

1\. You can put your custom filter inputs directly inside of the headers: https://snippet.webix.com/48my8027.

2\. Alternatively, it is possible to add some more logic on top of the existing custom filter. For instance, you can write your own sorting logic: https://snippet.webix.com/1a213d5a.

Thanks @Dzmitry … Thanks a lot for your response.
Have one more query on sorting.
In the below snippet i have a column named “Train Name” which has date format and is not getting sorted. Can you please advise on how to sort date field (Train Name)in pivot table?

“Train Time”: “1/6/2020 11:14:35.000000”

https://snippet.webix.com/u7lbz5wv

Hey @sangeetha,

Can you please advise on how to sort date field (Train Name)in pivot table?

You can assign a custom sorting function for the columns containing these dates. For example: https://snippet.webix.com/cmzio727. As you can see, we are converting strings into Date objects and comparing them against each other.

Thanks a lot @Dzmitry