Reputation: 3688
I'm using YiiBoostrap in my Yii app and I have a TbListView output some images.
<?php
$this->widget('bootstrap.widgets.TbListView',array(
'dataProvider'=>$dataProviderModerator,
'id'=>'website-grid',
'itemView'=>'_viewWebsite',
'template'=>'{items}',
'itemsCssClass'=>'grid-group row m-t-25',
'cssFile'=>false,
'summaryText'=>false,
'pager'=>array(
'header'=>'',
'cssFile'=>false,
'maxButtonCount'=>10,
'selectedPageCssClass'=>'active',
'hiddenPageCssClass'=>'disabled',
'prevPageLabel'=>'‹',
'nextPageLabel'=>'›',
),
'htmlOptions'=>array('class'=>'')));
?>
Output
I would like to add a div manually to the end of above generated lists, which I'm expecting something like this
How can I do this?
Upvotes: 1
Views: 286
Reputation: 915
You can modify your 'template'=>'{items}',
property by adding custom HTML with element:
'template'=>'{items}<div id="my_custom_element">Foo bar</div>',
or the same in more „elegant“ way:
// regarding your 'itemView'=>'_viewWebsite'
$item = $this->renderPartial('_viewWebsite', array(
'your' => 'custom',
'vari' => 'ables',
));
and
'template'=>'{items}'.$item,
Upvotes: 1
Reputation: 915
It must be possible with jQuery:
$('<div id="my_new_element">HUGE PLUS SIGN with all functionality</div>')
.appendTo('#website-grid');
You can put this inside some JavaScript function and call it when needed. E.g. at first time or afterAjaxUpdate
in your TbListView
. This is just an idea. See how create DOM element and CListView::afterAjaxUpdate().
Upvotes: 0