简体   繁体   中英

How do I hide all the checkboxes in jQgrid?

I need to hide all the checkboxes on a jQgrid and after read this two posts:

This is what I did:

// this only hides the first checkbox on the header
$('#gbox_grid_notification_queue').find('input[type="checkbox"]').hide();

// this does not hide anything at all
$('#gbox_grid_notification_queue').find('td input[type="checkbox"]').hide();

// this does not hide anything, same as previous one
var grid_notification_queue = $("#grid_notification_queue");
$("#cb_" + grid_notification_queue.id).hide();

What I am missing here?

If you use free jqGrid fork, then the solution would be very easy. You need just add

multiselectPosition: "none"

option to prevent creating checkboxs. It improves additionally the performance of multi-selection. I remind that here you can find different options of free jqGrid, which has relation with selection. The value of multiselectPosition could be "left" , "right" or "none" .

You can use this code

$("input[type=checkbox]").each(function() {
                $(this).hide();
            });

Try this:

$('#gbox_grid_notification_queue').find('input[type="checkbox"]').each(function(){ 
    $(this).hide();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM