I have this code to Search grid from external form.
var grid = jQuery("#grid");
var searchFiler = jQuery("#txtSearch").val(), f;
f = {groupOp:"OR",rules:[]}; f.rules.push({field:"itemASIN",op:"eq",data:searchFiler});
grid[0].p.search = true;
jQuery.extend(grid[0].p.postData,{filters:JSON.stringify(f)});
grid.trigger("reloadGrid",[{jqgrid_page:1,current:true}]);
after calling the last line, it throws error
TypeError : g undefined
1 Answers
Check following:
1) On line, var grid = jQuery("#grid"); … #grid should be your grid id , e.g. if it is ->render('list1') then it will be #list1
2) Check if there are no dupliocate jquery versions included later after grid load. There is a possibility that later jquery include would have removed grid object.
Your Answer