eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Active table filter of a hidden column #121

Open viper4gh opened 6 years ago

viper4gh commented 6 years ago

If you enable a filter on a column which will be hidden after a Session change then you cannot clear it. For example you set a pits=1 filter during race of a demo file. After the playback begins again and there is a qualification the driver table is empty, because never has pit stop and you cannot clear the filter, because the column is hidden.

A new button "Clear all filter" could help, if this is available in jqgrid. Or automatically clear all filters on a session change.

viper4gh commented 6 years ago

The following commands could help:

jQuery("#DriverDataTable").setGridParam({ postData: { filters: {}} }).trigger("reloadGrid");
jQuery("#DriverDataTable")[0].clearToolbar();

The first clears the filter for the data and the second clears the input fields in the filter toolbar

if you use it, then the indicator for the number of filtered elements ist not working, because ist is only updated AfterSearch: https://github.com/eckhchri/pcars-ds-liveview/blob/master/index.html#L825