Getting Filtered Ids From Cgridview


I have a problem of getting filtered IDs List for some charts from CGridview after/before applying filter any idea/steps/solution/code/method Please working for last 3 days on it?

thanks in advance!

from client side (web browser) you can use jquery:

//assume your grid hase id: my-grid

$('#my-grid').find('div.keys span').each( function() {

  var id = $(this).html();

} );


thanks for reply.

I am using your script something like


        'success': function(data) {



        'type': 'POST',

        'data': $.fn.yiiGridView.getSelection('violence-mentioned-grid'),

        'url': '" . $this->createUrl('/violencementioned/getIDs') . "',



and getting the data in controller,

public function actionGetIDs(){


          foreach($_POS as $key=> $value){



               echo $value;


but i looping data i get nothing!,inspected in firebug console

can please Give me example or correct my code b/c i have not tried this , thank you soooooooooooo much.

thanks for reply but CODE having problems with pagination (it only shows first page) and i have huge data. any solutions? please

again this having problem with pagination!!!!!!!!!!!! i.e i m getting only row IDs , which are in grid!!

well… this is how it works (in both cases). if you need all id’s you have to extend default grid and make it work like you wish…

thanks, i m using session to hold the IDs as string in search ,thank you very much