Hey all,
Firstly to say I’m a total noob with Yii, 9 days in. So please be gentle with me
I have a page which has two TbGridView grids on it.
They are both driven by one controller with different methods in their model and each has it’s own partial view.
Both tables are identical except the data that they display.
Each table has it’s own id.
My issue comes when I enter something in the filter text field at the top.
Whatever I enter into the top grid and hit enter then populates into the second grid.
It seems that the textfield has an ID or some such that I need to change.
Unfortunately I don’t know where that can be changed.
One of my partial views for reference. There are obviously two views but they are identical except the ID
$this->widget('bootstrap.widgets.TbGridView', array(
'dataProvider' => $data,
'filter' => $model,
'id' => 'subject-split-grid',
'type' => 'striped bordered condensed',
'template' => $data->totalItemCount > OverviewController::PAGE_SIZE ?
'<div class="row-fluid"><div class="pull-right">'.$filterBtn.'</div><div class="pull-right" style="padding-top:5px;">{summary}</div></div>{items}<div class="row-fluid"><div class="pull-left">{pager}</div><div class="pull-right" style="margin-top: 20px;">'.$filterBtn.'</div></div>':
'<div class="row-fluid"><div class="pull-right">{summary}</div></div>{items}<div class="row-fluid"><div class="pull-left">{pager}</div></div>',
'htmlOptions' => array(
'style' => 'margin-bottom: 0;'
),
'columns' => array(
array(
'name' => 'full_subject_name',
),
array(
'name' => 'totalS',
'htmlOptions' => array('style'=>'text-align:center;'),
'header' => 'No. S',
'headerHtmlOptions' => array('style'=>'text-align:center;width:100px;'),
'footer' => $model->totalSFooter.' <sup style="font-size:.55em; font-weight:normal; top:-.8em;">†</sup>',
'footerHtmlOptions' => array('style'=>'text-align:center;font-weight:bold;font-size:1.1em;'),
'filter' => false
),
array(
'name' => 'totalR',
'htmlOptions' => array('style'=>'text-align:center;'),
'header' => 'Total R',
'headerHtmlOptions' => array('style'=>'text-align:center;width:100px;'),
'footer' => $model->totalRFooter,
'footerHtmlOptions' => array('style'=>'text-align:center;font-weight:bold;font-size:1.1em;'),
'filter' => false
),
array(
'name' => 'totalP',
'htmlOptions' => array('style'=>'text-align:center;'),
'header' => 'Total P',
'headerHtmlOptions' => array('style'=>'text-align:center;width:100px;'),
'footer' => $model->totalPFooter,
'footerHtmlOptions' => array('style'=>'text-align:center;font-weight:bold;font-size:1.1em;'),
'filter' => false
),
array(
'class' => 'application.widgets.bootstrap.TbButtonColumnFilter',
'header' => 'Actions',
'filter' => CHtml::link('<i class="icon icon-remove"></i> Remove Filters', array('subject', 'clearFilters'=>1), array('class'=>'remove-filters')),
'visible' => !isset($attribute),
'buttons' => array(
'view' => array(
'type' => 'primary',
'url' => '$data->subject_message_link ? "/carrot/overview/subject/id/".$data->subject_id."/msg/".urlencode($data->message)."/tab/'.$activeTab.'" : "/carrot/overview/subject/id/".$data->subject_id."/tab/'.$activeTab.'"',
),
'update' => array(
'visible' => 'false',
),
'delete' => array(
'visible' => 'false',
),
),
'headerHtmlOptions' => array('style' => 'text-align:center; width: 50px;'),
),
),
));
I hope this makes sense, and thanks in advance for the help.