【问题标题】:I want to get data from grid when checkbox is selected选中复选框时,我想从网格中获取数据
【发布时间】:2018-02-02 00:29:08
【问题描述】:

$("#wa30_05_roomList").kendoGrid({

         dataSource: wa30_05_roomDataSource,
         height: 550,
         autoBind: false,
         groupable: false,
         scrollable : true,
         sortable: true,
         selectable: 'row',
         change: fn_wa30_05_gridClick,
         columns: 
         [
             { title: "<span class='checkbox'><input id='wa30_05_allChk' type='checkbox'><label for='wa30_05_allChk'></label></span>"
             , width: 30 , template: '<span class="checkbox"><input id=wa30_05_#=room_no# name="wa30_05_choice" type="checkbox" value=#=room_no#><label for=wa30_05_#=room_no#></label></span>'},
             { field: "room_no"                 , title: "roomNo"   , width: 50}, 
             { field: "room_type_name"          , title: "roomName"     , width: 40}, 
             { field: "room_status_name"        , title: "roomStatusName"   , width: 50},
             { field: "remark"                  , title: "remark"       , width: 100}
         ]

     });

如果您按下“保存”按钮,我只想将数据项提供给那些在网格中选中复选框的人。

【问题讨论】:

    标签: javascript kendo-grid


    【解决方案1】:

    一般解决方案:遍历复选框

       ` $("input[type=checkbox]").each(function(index,elem){
                if(this.checked==true){
                    $(this).parent().parent()
            //you can get tr element then get the data you want
            }
            });` 
    

    具体解决办法:读取你使用的网格控件的文档;一定有一些方法可以帮助你获取数据。

    【讨论】:

      猜你喜欢
      • 2011-09-12
      • 1970-01-01
      • 2011-03-03
      • 2013-09-28
      • 2013-07-31
      • 1970-01-01
      • 2013-10-09
      • 2012-03-04
      • 1970-01-01
      相关资源
      最近更新 更多