2

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?

halera
  • 165
  • 2
  • 9

1 Answers1

2

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).

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Hello again, Oleg! I am using jqGrid 4.3.1 and jQuery 1.7, but I am not able get my checkbox values to POST on form submit. (I am using inline edit.) Before I posted a full SO question, I wanted to check to see if my versions of jqGrid and jQuery are OK for this issue. Thanks! – bflow1 Jan 20 '12 at 00:11
  • @bflow1: jqGrid 4.3.1 and jQuery 1.7.x should work together without any problem. If you have a problem and suppose that it is a bug you should post the corresponding test case, so that other could reproduce the problem. – Oleg Jan 20 '12 at 00:31
  • Oleg, thanks. I do not think it is a jqGrid bug. I just cannot seem to get checkbox values to POST on a submit. Here is my colmodel: – bflow1 Jan 20 '12 at 01:03
  • { name: "Checkbox", editable: true, edittype: "checkbox", editoptions: { value: "Y:N", defaultValue: "N" }, formatter: 'yesNoFormatter' } – bflow1 Jan 20 '12 at 01:11
  • @bflow1: You use custom formatter `yesNoFormatter`. Why you use it as string 'yesNoFormatter' and not as function? Why you need to define the custom formatter and not use predefined 'checkbox' formatter? Moreover I don't see where you defined the corresponding unformatter? Could you better post new question with the full code of jqGrid, code of yesNoFormatter and the testdata? – Oleg Jan 20 '12 at 06:33
  • Oleg, thanks. I'll go ahead and post a full SO question, and link to it from here. – bflow1 Jan 20 '12 at 23:57