use JS code to filter a QWP w/o page reloading?

LabKey Support Forum (Inactive)
use JS code to filter a QWP w/o page reloading? Ben Bimber  2010-05-19 06:02
Status: Closed
 
i have a QWP with a custom button. the button handler runs a query and returns a list of subject IDs. i'd like to take this list of IDs and filter the grid (query.id~in=x;y;z). it'd be nice to do this without page reloading since 10.2 supports that.

can i use javascript to apply a filter to that grid? in the past i always did this sort of thing using URL params, but this requires navigation.

thanks in advance.
 
 
jeckels responded:  2010-05-19 17:43
Hi Ben,

If you already have a QueryWebPart, you should be able to just change its filters property (which is the same array as was passed in with the config object's filter property) and call render() on it. That should re-query the server and swap out its contents in the existing page, avoiding a full page navigation.

Thanks,
Josh