Preload a user-defined filter at runtime in list page

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
Andros
User
Posts: 111

Preload a user-defined filter at runtime in list page

Post by Andros »

Hi, in the list page the user can use the advanced search to run a query, and then can save the filter with a specific name.
I want that if the filter name is "Default" when the user comes back to the list page that filter is applied and the list is filtered.
1) How can I do this?
2) Is there any way to save the filter for "Query builder" filters also?


MichaelG
User
Posts: 1095

Post by MichaelG »

You can simulate the filter click event by using the following codes in Client Start up script:

if (this.filterList && this.filterList.filters) {
  setTimeout(function() {
      $(".ew-filter-option").find("button").click(); 
      var $filter = $(".ew-filter-option").find(".ew-reset-filter-list").filter(function () { return $(this).text() == "default"; });
      if ($filter)
          $filter.click();
  }, 1000);
}

NOTE THAT you need to add some checking to see if the default filter is loaded, or the page will be loaded repeatedly

It seems that currently Query Builder does not support save to filter


Post Reply