1

I'm having requirement in KendoUI Grid where I have first column as Command template for checkbox,so on its onclick event I want to get value and ids of all the columns of same selected row. below is the column section of my grid

columns: [                            
    {command: "", template: '<input type="checkbox" id="check-all" onclick="chkboxclicked(this)"/>', width: "15" },
    { field: "Hours", template: '<input type="textbox" id="txthours" style="width:70px;"/>', width: "30" },
    { field: "OT Hours", template: '<input type="textbox" id="txtOThours"  style="width:70px;"/>', width: "30" },
    { field: "SkillName", title: "Skill", width: "50" },
    { field: "UserName", title: "Technician", width: "65" },
    { field: "StartTimeString", template: '<input type="datetime" id="txtLaborstartdate" style="width:200px;"/>', title: "Start Date time", width: "75" },
    { field: "EndTimeString", template: '<input type="datetime" id="txtLaborEnddate" style="width:200px;"/>', title: "End Date time", width: "75" }
]

I have also attached a screenshot for more detail, please let me know how it can be done.

4

1 回答 1

1

尝试这个,

Function chkboxclicked(obj){
       var id = $(obj).attr('id');
        var IsChecked = $(obj).is(':checked');
        var rowIndexchild = $(this).parent().index();
        var cellIndexchild = $(this).parent().parent().index();
         var grid = $("#YourGridName").data("kendoGrid");

       var datatItem = grid.dataItem(grid.tbody.find('tr:eq(' + cellIndex + ')'));


      var SkillName= datatItem.SkillName;
      var UserName= datatItem.UserName;
      var StartTimeString= $('#txtLaborstartdate').val();
      var EndTimeString= $('#txtLaborEnddate').val();
      var hours = $('#txthours').val();
      var OThours = $('#txtOThours').val();


}

你可以找到Hours$('#txthours').val().

于 2013-08-14T11:32:34.390 回答