GridView-CheckBox- Persist values

I am trying to modify the CRUD and trying to persist the values of checked checkboxes after the Search or new page so that when user clicks on the save button, i can save it to database.

My GridView is something like

<?php Pjax::begin(); ?>

&lt;?= 


	GridView::widget([


        'dataProvider' =&gt; &#036;dataProvider,


        'filterModel' =&gt; &#036;searchModel,	        


        'columns' =&gt; [


			[


    			'class' =&gt; 'yii&#092;grid&#092;CheckboxColumn',


    			'checkboxOptions' =&gt; function(&#036;model, &#036;key, &#036;index, &#036;widget) {


					return [&quot;value&quot; =&gt; &#036;model-&gt;id, ];


				},


			],


			


            'rollno',


            'username',


            'name',


            'phoneNumber',


        ],


    ]);


?&gt;

<?php Pjax::end(); ?>

and the JS is:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script>

$(document).ready(function() {

&#036;('#submit-form').on('click',function() {


var keys = &#036;('#w1').yiiGridView('getSelectedRows');


alert(keys[0]);


&#036;.post({


	   type     :'POST',


	           cache    : false,


	   url: 'index.php?r=/users/testdemo', 


	   dataType: 'json',


	   data: {keylist: keys},


	   success: function(data) {


             alert(data);


            }


	});		


});

});

</script>

Please Help!!!