Default Autofilter does not work on load

QuestionsDefault Autofilter does not work on load

On the loading of a page, I would like to automatically put a 1 into the search field. I have it working but it does not filter on load. If I go back into the cell and put 1 then it the search works. Here is the code I am using:

$col = array();
$col["title"] = "Active"; // caption of column
$col["name"] = "active"; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col["width"] = "5";
$col["align"] = "center";
$col["editable"] = true;
$col["hidden"] = false;
$col["search"] = true;
$col["searchoptions"] = array("defaultValue"=>'1');
$cols[] = $col;

When the page loads the Active filter field does contain 1 but it displays all results, not just 1.

Thanks

1 Answers
Abu Ghufran answered 7 years ago

Hi,

Please refer demos/search/search-onload.php demo for your requirement.

It need one additional setting.

Your Answer

18 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?