tonytomov/jqGrid — Issue #194: search + select + IsNull
Author: Dluis
Created: 2011-11-07 16:02:15+00:00
State: open

Search with SelectBoxes

If I try to search with equal it makes the search ok, but if I search Is Null and then I go to Equal(or another), the "Data" field in Json will always be empty after I make a Is Null or Not Is Null search. I need to change the value in the selectbox or make another action.

Here is my sugestion for a fix:

ruleOperatorSelect.bind('change',function() {
rule.op = $(ruleOperatorSelect).val();
trpar = $(this).parents("tr:first");
var rd = $(".input-elm",trpar)[0];
if (rule.op === "nu" || rule.op === "nn") { // disable for operator "is null" and "is not null"
rule.data = "";
**if(rd.tagName.toUpperCase() != 'SELECT') rd.value = "";**
rd.setAttribute("readonly", "true");
rd.setAttribute("disabled", "true");
} else {
**if(rd.tagName.toUpperCase() == 'SELECT') rule.data = rd.value;**
rd.removeAttribute("readonly");
rd.removeAttribute("disabled");
}

that.onchange(); // signals that the filter has changed
});