Frage

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}
                });
            }',
        ),
      ), 
)
War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top