0

2 つの剣道 ui グリッド (親グリッド、子グリッド) があり、グリッドの行のチェックボックスをクリックすると、親グリッドにチェック ボックス列があり、対応する行データを取得する必要があり、それを移動する必要があります。ボタンをクリックすると、行データを別のグリッドに選択して、このようにボタンクリックを実装しました...

そのために私はこのようにしました....

    @Scripts.Render("~/bundles/jquery")
    <script type="text/javascript">
    $(document).ready(function ()
    {
        $('#btnMove').click(function() {

            ('#GridParent').on("click", "td", function (e) {
                var selectedTd = $(e.target).closest("td");
                var grdChkBox = selectedTd.parents('tr').find("td:first").next("td").find('input:checkbox');
                //grdChkBox.prop('checked', !grdChkBox.prop('checked'));
                if(grdChBox.Checked)
                {
                   // here I need to get the checkbox selected item row data 
                  // i dont know it is the correct way to get the item pls correct me                                                                  
                }   

            var sourcegrid =  $('#GridParent').data('kendoGrid');
            var destinationgrid =  $('#ChildGrid').data('kendoGrid');

            var checkeditem =                        
            });       
</script>
@model IEnumerable<KendoSampleMVCApp.Models.StudentDetails>
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
@using (Html.BeginForm())
{ 
    @(Html.Kendo().Grid<KendoSampleMVCApp.Models.StudentDetails>()    
    .Name("GridParent")
    .Columns(columns => {
        columns.Bound(p => p.studentclass).HeaderTemplate("<input id='selectall' class='chkbx' type='checkbox' onclick='ToggleChkBox(this.checked);' />").ClientTemplate("<input id='checkbox' onclick='grdChkBoxClick(this); ' class='chkbxq' type='checkbox' />").Sortable(false).Filterable(false).Width(30);
        columns.Bound(p => p.studentId).Filterable(false).Width(90);
        columns.Bound(p => p.studentName).Filterable(false).Width(90);
        columns.Bound(p => p.StudentBranch).Filterable(false).Width(90);

    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .Resizable(resize => resize.Columns(true))
    .Reorderable(reorder => reorder.Columns(true))
    .Selectable(s => s.Mode(GridSelectionMode.Multiple))
    .HtmlAttributes(new { style = "height:250px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("Orders_Read", "StudentDtls"))
     )
  )

 <input id="btnMove" type="button" value="Move" />
  // second grid .......

チェックボックスが選択されているときにデータを取得する方法がわかりません

誰でもこれについて助けてくれますか...どうもありがとう.....

4

1 に答える 1