Sometimes you need to show the Edit selected and Delete selected buttons only when users select records on the List page. For this purpose, add the following code to the List page: JavaScript OnLoad event:
var $editSelected = $('#edit_selected' + pageid),
$deleteSelected = $('#delete_selected' + pageid);
$editSelected.hide();
$deleteSelected.hide();
$('input[type=checkbox][name=^selection], #select_all' + pageid +', #chooseAll_' + pageid).change( function(e) {
var $target = $(e.target),
selBoxes;
if ( $target.attr('name') == 'selection[]' || $target.attr('id') == 'chooseAll_' + pageid ) {
selBoxes = pageObj.getSelBoxes( pageid );
$editSelected.toggle( selBoxes.length > 0 );
$deleteSelected.toggle( selBoxes.length > 0 );
}
});
See also:
•JavaScript API: Control object > hide()
•JavaScript API: Control object