javascript - Yii - YiiBooster GridView widget messes up partial page when given an id -
i have view parent-child subview layout. in parent view, have gridview yiibooster extension lists people in db:
$this->widget('bootstrap.widgets.tbgridview', array( 'dataprovider' => $model->search(), 'filter' => $model, 'ajaxupdate' => true, 'selectionchanged' => "updatechild", // new code 'columns' => array( 'firstname', 'lastname' ) )); it doesn't have id, , assigned 1 default, yw0.
the updatechild js method called on selectionchanged gets information of person , updates child view information using $('#childview').html(data). if parent gridview given explicit id, so:
$this->widget('bootstrap.widgets.tbgridview', array( 'id' => 'parentgrid' // explicit id 'dataprovider' => $model->search(), 'filter' => $model, 'ajaxupdate' => true, 'selectionchanged' => "updatechild", // new code 'columns' => array( 'firstname', 'lastname' ) )); the child view not update relevant data. took @ source, , function in controller worked fine, , passed relevant data back, it's rendering issue, refusing display.
also, if have gridview in child view somewhere (such listing various different categories person belongs to), following error when trying click on person: "cannot read property tableclass of undefined".
my child view partial view, , renderpartial() used. allow load in more scripts, since child view has js listeners click events on various elements in child view.
does have ideas what's going on? thanks.
edit: have gotten things working explicit id's now, got answer question. "cannot read property tableclass of undefined" problem still exists. seems when want put gridview child view through renderpartial(), messes gridview in parent view.
Comments
Post a Comment