halera
halera

Reputation: 165

jQuery 1.6.3 checkboxes issue in inline edit in jQgrid

I just updated jQuery from 1.6.2 to 1.6.3 and find out that inline edit not working properly after that change.

I have check boxes and if I untick checkbox(value true switched to false) and click save, the value of that tickbox posted as true on controller but real value should be false because i changed that. Also if the value was 'false' (checkbox unchecked) and I change it to checked(true) it is working this way. So i it is only not working from checked to unchecked only(when i am unchecking the checkbox the value true always posted on server instead of 'false').

When I switched back to jQuery 1.6.2 all working as before, no issues with checkboxes.

My jQGrid version 4.1.2.

Is is a bug with jQuery 1.6.3?

Upvotes: 2

Views: 2089

Answers (1)

Oleg
Oleg

Reputation: 221997

Thank you for the question! In one project for my main customer the working with checkbox is very critical. So I reproduced immediately the problem. My first bug fix is the following:

one should change the line 133 (in the version 4.1.2) of the grid.inlinedit.js or the line 8283 of the jquery.jqGrid.src.js from

tmp[nm]=  $("input",this).attr("checked") ? cbv[0] : cbv[1];

to

tmp[nm]=  $("input",this)[0].checked ? cbv[0] : cbv[1];

I think one should examine the jqGrid code for more places where are worked with checkboxes, but the quick fix described above at least solve the problem in inline editing which you described. I will examine the problem more carefully later and will post my suggestions to trirand (to the developer of jqGrid).

Upvotes: 2

Related Questions