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

marker opacity is not changing if the filter result is changing #120

Open viper4gh opened 6 years ago

viper4gh commented 6 years ago

If you filter for example on pits = 1 the opacity of the markers is changing correct at this moment. But if you don't change this filter and a driver without stop is driving to pits, the driver table is updating automatically, but the opacity of his marker not.

eckhchri commented 6 years ago

Current situation: opacity css class assignment will be triggered within jqGrid Event afterSearch in table definition: https://github.com/eckhchri/pcars-ds-liveview/blob/master/index.html#L1709 It seem that reloadin data to grid do not fire such an event. So additional rows will not get the opacity css classes assigned.

Todo: fire after search event while loading new data to jqGrid OR call CSSClsChg.HideSpecificDrivers while realoading data http://www.trirand.com/jqgridwiki/doku.php?id=wiki:toolbar_searching#using_the_additional_methods

eckhchri commented 6 years ago

Maybe a jqgrid bug, upgrade to latest release 5.3.1 http://www.trirand.com/blog/?p=1640 http://guriddo.net/?p=126976 5.3.2 (Support for searchOperators im refreshToolBar method)

https://stackoverflow.com/questions/6217499/how-to-get-jqgrid-current-search-criteria

  1. var sFilterOptions = $('#myGrid').getGridParam("postData").filters

  2. jQuery("#grid_id").jqGrid('filterToolbar', sFilterOptions);

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_searching When using filterGrid we can use two additional privileged methods triggerSearch - triggers a search to the grid, for example,

var sg = jQuery("#mysearch").filterGrid(...)[0]; 
sg.triggerSearch();

clearSearch - clears the search form values and triggers the search with empty or default values.

sg.clearSearch();