jQgrid 中的内联编辑中的 jQuery 1.6.3 复选框问题 [英] jQuery 1.6.3 checkboxes issue in inline edit in jQgrid
问题描述
我刚刚将 jQuery 从 1.6.2 更新到 1.6.3,发现内联编辑在更改后无法正常工作.
I just updated jQuery from 1.6.2 to 1.6.3 and find out that inline edit not working properly after that change.
我有复选框,如果我取消勾选复选框(值 true
切换到 false
)并单击保存,则该复选框的值发布为 true
在控制器上,但实际值应该是 false
因为我改变了它.此外,如果该值为假"(未选中复选框)并且我将其更改为已选中(true
),那么它就是以这种方式工作的.所以我只是不能从选中到未选中(当我取消选中复选框时,值 true
总是发布在服务器上而不是'false').
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').
当我切换回 jQuery 1.6.2 时,一切都像以前一样工作,复选框没有问题.
When I switched back to jQuery 1.6.2 all working as before, no issues with checkboxes.
我的 jQGrid 版本 4.1.2.
My jQGrid version 4.1.2.
是 jQuery 1.6.3 的错误吗?
Is is a bug with jQuery 1.6.3?
推荐答案
感谢您的提问!在我的主要客户的一个项目中,使用复选框非常关键.所以我立即重现了这个问题.我的第一个错误修复如下:
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:
应该更改行 133grid.inlinedit.js
或 jquery.jqGrid.src.js
的第 8283 行的 a>(在 4.1.2 版本中)来自
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];
到
tmp[nm]= $("input",this)[0].checked ? cbv[0] : cbv[1];
我认为应该检查 jqGrid 代码以了解更多使用复选框的地方,但上述快速修复至少解决了您描述的内联编辑问题.稍后我会更仔细地检查这个问题,并将我的建议发布给 trirand(给 jqGrid 的开发人员).
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).
这篇关于jQgrid 中的内联编辑中的 jQuery 1.6.3 复选框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!