Customize Advance Search pop-p (add columns which are not in the grid list)

QuestionsCustomize Advance Search pop-p (add columns which are not in the grid list)
Talha asked 10 years ago

AssalamOAlaikum,

Scenario:
———
The database table has many columns (50+) and I am displaying only 7 to 10 on the grid, the Advance search popup only list the columns which are on display. Is there a way to have all the columns in the search only and not on the grid at the same time ?

One possible fix could be "add all the columns in the grid but display only the desired columns and hide the rest", this will add all the columns as search field in the Advance Search box ….. but it must have a negative impact on performance, secondly the search field list will become too long.

So is there a way to
1) Customize the search field list/options
2) Customize the look and feel of advance search popup

Many Thanks
Talha

4 Answers
Abu Ghufran answered 10 years ago

Beside what solution you already have in mind, You can enable certain column to be searched or not using following:
$col["search"] = false; // or true by default

By that, search field list won't grow too much.

Another option would be to use custom search form.
It's custom JS work, but gives you flexibility to have your own design.

Reder demos/search/search-form.php

Talha answered 10 years ago

Thanks for your quick response, I was referring to the Search form which shows up on clicking "Find Records" button at the tool bar.

From what I have observed, the columns/fields which are defined in $cols array (irrespective of their visibility), shows up in the "Search form". Is there a way to add searchable fields to this form which are not defined in $cols array?

In short, can we override the functionality/logic of this Search form/popup.

Thanks!

Talha answered 10 years ago

Can we override the functionality/logic of Search form/popup?

Abu Ghufran answered 10 years ago

No, it is generated using JS code and always pick the columns defined in $cols array.
You must define all columns in that array to make them available for search dialog.

Your Answer

16 + 9 =

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?