I have 1 master grid and 2 detail grids on the same page.
I implemented 1 Toolbar checkbox.
The checkbox is working fine but it should only be visible on the master grid instead of all 3 grids.
What should i change in my code to solve the problem?
// Add toolbar buttons with 100ms delay to complete grid setup properly
jQuery(“document”).ready(function(){
/*
CUSTOM TOOLBAR BUTTON
———————
caption: (string) the caption of the button, can be a empty string.
buttonicon: (string) is the ui icon name from UI theme icon set. If this option is set to ‘none’ only the text appear.
onClickButton: (function) action to be performed when a button is clicked. Default null.
position: (‘first’ or ‘last’) the position where the button will be added (i.e., before or after the standard buttons).
title: (string) a tooltip for the button.
cursor : string (default pointer) determines the cursor when we mouseover the element
id : string (optional) – if set defines the id of the button (actually the id of TD element) for future manipulation
*/
setTimeout(()=>{
// show checkbox in toolbar
jQuery(‘.navtable tr’).append(‘<td><div style=”padding-left: 5px; padding-top:0px;”><label><input class=”filtermore” type=”checkbox” /><span style=”float:right;padding-left:4px; padding-top:1px;”>Filter (nog niet bevestigd)</span></label></div></td>’);
jQuery(“.filtermore”).click(function(){
var type = ($(this)[0].checked)?1:0;
grid = jQuery(“#list1″);
if (type == 1)
grid.data(‘jqgrid_detail_grid_params’,’&query=1′);
else
grid.data(‘jqgrid_detail_grid_params’,”);
grid[0].p.search = false;
jQuery.extend(grid[0].p.postData,{‘query’:type});
grid.trigger(“reloadGrid”,[{page:1}]);
});
},10);
});
You need to pass:
jQuery(‘.navtable tr’,'#gbox_list1').append(...);
where list1 is the grid id where you want to have toolbar checkbox.