如何在jqgrid中创建一个单选按钮

时间:2014-02-06 04:30:59

标签: jquery jqgrid

这是jqgrid cheack box但我不会在点击提交按钮时取值,请任何人帮帮我..

edittype:'custom',
    editoptions: {
              custom_element: function() {
                  var elemStr = '<div class="col-xs-3">'+
                    '<label>'+
                    '   <input type="checkbox" class="ace ace-switch ace-switch-4" name="alternateMobileNumber">'+
                    '   <span class="lbl"></span>'+
                    '</label>';
                  return $(elemStr)[0];
              },
              custom_value: function(elem) {
                 var op = ($('input[name="alternateMobileNumber.value()"]').attr('checked'))? "1":"0";
                return op;
              }
          },

1 个答案:

答案 0 :(得分:0)

更改您的custom value function赞,

custom_value: function(elem) {
   var op = $('input[name="alternateMobileNumber"]').prop('checked') ? "1" : "0";
   return op;
}