Question

i need to stick with the current page after update the yiigridview ($.fn.yiiGridView.update()), so my problem is how to get the current page in js:

$this->widget('bootstrap.widgets.TbExtendedGridView', array(
'id' => 'stocktake-details-grid',
'dataProvider' => $dataProvider,
'columns'=>array(
      array(
        'class' => 'editable.EditableColumn',
        'name' => 'physical_qoh',
        'editable' => array(
            'url'       => array('StocktakeDetails/update'),
            'placement' => 'top',
            'onSave' => 'js: function(e, params) {
                $.fn.yiiGridView.update("stocktake-details-grid", {
                    data: {StocktakeDetails_page: currentpage}
                });
            }',
        ),
      ), 
)
Was it helpful?

Solution

You should have a $_GET attribute with a name something like [model_name]_page.

You can use the Network tab in Chrome Browser (i'm sure there is an equivalent in other browsers) to see what AJAX requests are being sent to check this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top