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.
精彩评论