vendredi 29 avril 2016

How to persist a checkall in nested kendo grid in pagination

I have 2 telerik grid,when i search , the parent grid loaded in the screen. when i expand some data, there have list of data. In parent grid have checkbox,when checkall the parentGrid,the child results are selected . pagesize is 20:when go to next page and back to previous page , the checkbox is not gets selected.

case: The problem is when checkall option is working the pagsize in childgrid when checkall in parent grid.

But when select the some row in child grid checkbox and come back to previous its working fine .

    <div ng-show="showGrid">
   <div kendo-grid="gridParent" k-options="gridOptions" id="parentGrid" class="hrScrollOut" k-rebind="gridOptions.selectable" k-data-source="parentDataSource"
             k-on-change="">
        <div k-detail-template>
                <div>
                    <div class="childGrid" id="childGrid" kendo-grid="childGrid" k-options="gridOptionsChild(dataItem)"></div>
                </div>
            </div>
        </div>

In telerik dynamically create the checkbox : 
template: "<input type='checkbox' class='checkbox' />" }

I have given this for child grid ,

> function onDataBound(e) {             var view = this.dataSource.view();
>           for(var i = 0; i < view.length;i++){
>               if(checkedIds[view[i].id]){
>                   this.tbody.find("tr[data-uid='" + view[i].uid + "']")
>                       .addClass("k-state-selected")
>                       .find(".checkbox")
>                       .attr("checked","checked");
>               }           }                   }

can anyone do the example in fiddler:




Aucun commentaire:

Enregistrer un commentaire