开发者

How make check box in the jqgrid uncheckable

开发者 https://www.devze.com 2023-02-13 10:56 出处:网络
I need to make a check-box uncheckable in JqGrid. I have made a custom formatter to call a function for onClick event of the checkobx.

I need to make a check-box uncheckable in JqGrid. I have made a custom formatter to call a function for onClick event of the checkobx.

return "<input type=\"checkbox\" " + bchk +" onClick=\"clickMe\" " + " value=\""+
       cval+"\" offval=\"no\" "+ds+ "/>";

This function gets called fine. Now I don't know how to stop 开发者_如何学编程the user from checking the unchecked check-box. What I am trying to say is the user should be able to un-check but should be able to check again.

Thanks, Abhi


I recommend you to make unobtrusive style binding to the onClick event (see this and this answers for details. Inside of event handle you can use e.preventDefault(); to prevent default behavior of the chechbox click.

0

精彩评论

暂无评论...
验证码 换一张
取 消