Filter table using Javascript

Hi Guys, is there a way to filter a table using Javascript? I want to pass on the filter parameters to Javascript that will execute when the page renders. I have seen that one can manipulate table filters using the API in this article

http://helpdesk.knackhq.com/support/solutions/articles/5000447623-api-reference-filters-search


I basically want to do the same thing, but when a table (or report for that matter) renders.

Thanks




When I filter a table, Knack adds some elements to the end of the URL. I have a table at this URL

https://xxxxxxx.knack.com/logistics#asset-master-list-view/

and when I add a filter ("status = working") to the table, the URL becomes:

https://xxxxxxx.knack.com/logistics#asset-master-list-view/?view_76_filters=%7B%22match%22%3A%22and%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22field_23%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%22Working%22%2C%22field_name%22%3A%22Status%22%7D%5D%7D&view_76_page=1

Translating using http://meyerweb.com/eric/tools/dencoder/ from the question mark:

?view_76_filters={"match":"and","rules":[{"field":"field_23","operator":"is","value":"Working","field_name":"Status"}]}&view_76_page=1

Which appears to be a similar/identical string to var filters in the API page you mentioned.

Perhaps one way to do this would be to manually filter the table, use the URL to determine what filter properties should exist and use javascript to redirect the user to the "filtered" page (being careful not to get users stuck in a loop, ie check they're not already on a filtered view before redirecting).

This probably wont stop users from un-filtering the table (unless you can hide that control, which should be possible).

Likely it's not a secure way of doing as user can probably freeze the page with all the records before their view becomes filtered.