Prevent url parameter based column-search if columnfieldname not exists

QuestionsPrevent url parameter based column-search if columnfieldname not exists
Mario asked 3 years ago

I am usuing your snippet fot search from an url parameter to have immediately a result when using a parameter from url.

If I pass filename.php?list1_colfieldname=searchedterm-
I get everything fine if the column to search is there.

But I get an error, when the column is not there. Sinde I use $_SERVER['QUERY_STRING'] in the urlall parameters are always transfered. I do not like to change this. So is there a possiblity not to use this skript, if the urlparameter is not there:

The snipped I got from you (which works if columnt is there) is:

// bind custom reload handler, required for url based filters
$(window).load( function () {
$('#refresh_list1').unbind( "click" );
$('#refresh_list1').click( function (event) {

// new handler for reload button – with postData
function reloadGrid()
var grid = $("#list1");

// reset default values of filters
var filters = grid[0].p.postData.filters;
for(var i in filters.rules)
var f = filters.rules[i].field;
var d = filters.rules[i].data;

<!– snippet for url filter end–>

Could you tell how to stop the script working if column is NOT there?

2 Answers
Abu Ghufran answered 3 years ago

I've emailed you updated build that will ignore the filter if column is not found in url param. answered 3 years ago

Thank you. It works now. Great!

Your Answer

10 + 2 =

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 / 5. Vote count:

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

Let us improve this post!