سؤال

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}
                });
            }',
        ),
      ), 
)
هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top