jqxgrid - Why checkRow not working in other than first page in jqxTreeGrid? -


i have jqxtreegrid, i’m selecting rows, selects rows on first page. on other pages, it’s not selecting.

$scope.get_db_data_parent = function (rowdata) { if(rowdata == undefined){ var url = ‘api/bdi_pf_data’; } else{ var url = ‘api/bdi_pf_data_not_platform_id?platform_id=’ + rowdata.platform_id; } $http.get(url).success(function (data) { console.log(url, data.response); var view = 0; var ids = [] if (rowdata !== null && rowdata !== undefined) { view = 1; ids = rowdata.parent_platfoms.split(“,”); } var table_contents = []; (var = 0; < data.response.length; i++) { arr_list_parent.push(data.response[i]) data.response[i][‘select’] = false; var = data.response[i]; table_contents.push({ select: a[‘select’], platform_id: a[‘platform_id’], platform_name: a[‘platform_name’], platform_type: a[‘platform_type’], template_name: a[‘template_name’] }) } console.log(table_contents); var source = { datatype: “json”, datafields: [ { name: ‘select’, type: ‘bool’ }, { name: ‘platform_id’, type: ‘number’ }, { name: ‘platform_name’, type: ‘string’ }, { name: ‘platform_type’, type: ‘string’ }, { name: ‘template_name’, type: ‘string’ } ], // hierarchy: // { // keydatafield: { name: ‘event_id’ }, // parentdatafield: { name: ‘event_parent_id’ } // // }, // id: “platform_id”, localdata: table_contents }; console.log(source); //angular.copy(source, $scope.griddata); var dataadapter = new $.jqx.dataadapter(source); $(“#treegridplatform”).on(‘bindingcomplete’, function (event) { // try { if (view == 1) { (var = 0; < ids.length; i++) { (var j = 0; j < table_contents.length; j++) { if (table_contents[j].platform_id.tostring() == ids[i].tostring()) { var t = table_contents[j].platform_id.tostring(); table_contents[j].select = true; } } } } //for (var = 0; < table_contents.length; i++) { //if (table_contents[i].select == true) { // var p = table_contents[i].platform_id; //$(‘#treegridplatform’).jqxtreegrid(‘checkrow’, i); //if(i == ) $timeout(function () { try { $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, 2); $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, 5); $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, 45); $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, 51); } catch (e) { } }, 5000) //$(‘#treegridplatform’).jqxtreegrid(‘checkrow’, 38); //} //} // } // catch (e) { // // } }); // create tree grid var editable = true; if ($scope.update == true && $scope.view == true) { editable = false; } $(“#treegridplatform”).jqxtreegrid( { width: ‘100%’, source: dataadapter, sortable: true, editable: true, pageable: true, pagermode: ‘advanced’, checkboxes: true, theme: ‘arctic’, filterable: true, //filtermode: ‘simple’, incrementalsearch: true, //columnsresize: true, // ready: function() // { // $(“#treegrid”).jqxtreegrid(‘expandrow’, ‘2’); // // }, editsettings: { editondoubleclick: false }, columns: [ // { // text: ‘select’, // width: ‘10%’, // datafield: ‘select’, // columntype: ‘checkbox’, // type: ‘bool’, // pinned: true // }, { text: ‘platform id’, datafield: ‘platform_id’, editable: false }, { text: ‘platform name’, datafield: ‘platform_name’, cellsrenderer: cellsrenderercenter, editable: false }, { text: ‘platform type’, datafield: ‘platform_type’, type: ‘string’, editable: false, cellsrenderer: cellsrenderercenter }, { text: ‘database type’, datafield: ‘template_name’, type: ‘string’, editable: false, cellsrenderer: cellsrenderercenter } ], columngroups: [ { text: ‘name’, name: ‘name’ } ] }); var user_clicked = true; $(“#treegridplatform”) .on(‘rowcheck’, function (event) { var args = event.args; var row = args.row; var platform_id = row.platform_id; // if (editable == false && user_clicked == true) { // user_clicked = false; // $(‘#treegridplatform’).jqxtreegrid(‘uncheckrow’, platform_id); // return false; // } // else if (editable == true) { // // try { // if (row.parent == null) { // (var index = 0; index < row.records.length; index++) { // $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, row.records[index].platform_id); // } // } // } // catch (e) { // // } // } user_clicked = true; selected_platform_id.push(platform_id); }); $(“#treegridplatform”) .on(‘rowuncheck’, function (event) { var args = event.args; var row = args.row; var platform_id = row.platform_id; // if (editable == false && user_clicked == true) { // user_clicked = false; // $(‘#treegridplatform’).jqxtreegrid(‘checkrow’, platform_id); // return false; // } // else if (editable == true) { // // try { // if (row.parent == null) { // (var index = 0; index < row.records.length; index++) { // $(‘#treegridplatform’).jqxtreegrid(‘uncheckrow’, row.records[index].platform_id); // } // } // } // catch (e) { // // } // } user_clicked = true; var = selected_platform_id.indexof(platform_id); if (i > -1) { selected_platform_id.splice(i, 1); } }); $(‘#treegridplatform’).on(‘cellbeginedit’, function (event) { var args = event.args; // row key var rowkey = args.key; // row’s data. var row = args.row; // column’s data field. var columndatafield = args.datafield; // column’s display field. var columndisplayfield = args.displayfield; // cell’s value. var value = args.value; }); } ) .error(function (error) { console.log(url, error); }); }  $scope.get_db_data_parent();  <div id="treegridplatform" ng-if="(newplatform == true || update == true)" ng-disabled="update && view">             </div> 


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -