Cgridview Select All Including Pagination


I want to give functionality that exist in megento grid-view like "checked-all","unchecked-all","checked-visible","unchecked visible".

I’m using selgridview extension and extending as above described manner and i stuck with that what if we want to select all check-boxes regardless of pagination and get all the Id’s on single button click.

I go through all the internet sources but none of have this answer.

I attached my code file below and also attached the screenshot for clear understanding.

Please find statement "$("#select-all").click(function(){" in file and tell me what should i write to get this functionality.

So i urge you to help me out with this problem.

Thanks for your time and consideration in advance.


Naitik joshi(Developer)

in your admin.php why you are write the hide function i think it’smay be happeen this syntax

'afterAjaxUpdate'=>'function() { $(\'\').hide(); }', 

i think you can create the function and call this function on afterAjaxUpdate admin.php


function checkAll(){

   //write a all checkbox select code


$(document).ready(function() {

   // Handler for .ready() called.

  // call this function on page load first time




and call this function on

'afterAjaxUpdate'=>'function() { checkAll() }', 

Hi Ankit,

Thanks for your time.

I have this code like this

$(’#vk-api-help-grid’).find(‘input[type=checkbox]’).attr(‘checked’, true );

But my actual question is it’s not possible this way.

Let me explain in detail

for example client click on “select all” button but he will not navigate through pagination and directly click on delete action then on controller side how can we get all records id’s within the grid?

I think it’s not that easy.



I think this will not work while we click on oh

Yes you are right so best way you can add a one more button deleteAll so if user selected all chekbox so you want to deleteall selectedchekcbox option or if you want to delete only one recored you must be only one chekcbox selected then after you may delete this recored.