admin管理员组文章数量:1424079
How to create a grid with one special column of radio buttons in such a way if user click on this column of a particular row then only this radio button gets selected like if there is a radio group spread across this column of grid vertically ??
I am looking for this solution in JqGrid (jquery) specifically .
Thanks.
How to create a grid with one special column of radio buttons in such a way if user click on this column of a particular row then only this radio button gets selected like if there is a radio group spread across this column of grid vertically ??
I am looking for this solution in JqGrid (jquery) specifically .
Thanks.
Share Improve this question asked Sep 13, 2011 at 11:40 Mr CoderMr Coder 8,1965 gold badges48 silver badges74 bronze badges1 Answer
Reset to default 5If I understand you correct you can just use custom formatter. If all the buttons which you included has the same name
attribute you will have the behavior which you need
formatter: function (cellValue, option) {
return '<input type="radio" name="radio_' + option.gid + '" />';
}
After creating the column with radio buttons you will receive many other questions how to synchronize other functionality of jqGrid with the radio buttons. In the following example I show you how you can check the radio button on selecting the row:
beforeSelectRow: function (rowid, e) {
var radio = $(e.target).closest('tr').find('input[type="radio"]');
radio.attr('checked', 'checked');
return true; // allow row selection
}
See the demo here.
本文标签:
版权声明:本文标题:javascript - radio button column mutually exclusive within all grid rows for this radio column using JqGrid? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745397685a2656891.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论