Hello Everybody,
I’m currently rendering 3 CGridviews in my view, all using “renderPartial” and the same php file. This works fine, except for when using pagination, and the user selects another page of results, it moves all the CGridviews to that page (if they can). I’m not sure why this is happening or how to fix it. Here is an image of what this looks like:
5626
Here is the CGridView Template
<div class="row btn-row">
<h2 class="admin-h1"><?php echo $title; ?></h2>
<div class="btn-block-div">
<button class="btn addOrgBtn" id="<?php echo $title; ?>">Add</button>
</div>
</div>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>$title .'-table',
'dataProvider'=>$dataProvider,
'selectableRows'=>1,
'hideHeader'=>true,
'selectionChanged'=>'viewRoles',
'columns'=>array(
array(
'header'=>'Name',
'name'=>'Organization',
),
'Roles',
),
));
?>
and here are the three "RenderPartial" statements inside of my view
<div class="col-md-4 col-sm-4 col-xs-12" id="School-grid">
<?php echo $this->renderPartial('_roleTable', array('title'=>'School', 'model'=>$model, 'dataProvider'=>$schoolItems)); ?>
</div>
<div class="col-md-4 col-sm-4 col-xs-12" id="Classroom-grid">
<?php echo $this->renderPartial('_roleTable', array('title'=>'Classroom', 'model'=>$model, 'dataProvider'=>$classroomItems)); ?>
</div>
<div class="col-md-4 col-sm-4 col-xs-12" id="Shared-grid">
<?php echo $this->renderPartial('_roleTable', array('title'=>'Shared', 'model'=>$model, 'dataProvider'=>$sharedItems)); ?>
</div>
If I add the parameters (false, true) to the end of the “RenderPartial” statements, it fixes the pagination problem, but all of my custom JS and the CSS styling’s are gone. Here is an image of what this looks like:
5625
I’m not sure what’s causing this issue, as inspecting the page in both cases produces identical widget and JS code. Thank you in advance for the help, I’m really looking forward to solving this.