Need help to extend cgridview to put a addnew button on upper right cell on the filter row.
Apreciate
Need help to extend cgridview to put a addnew button on upper right cell on the filter row.
Apreciate
it’s done .
But i need the controller id of the view.
I’m using partials and always get the parent controller name
<?php
$this->breadcrumbs=array(
'Opções'=>array('admin'),
'Painel'
);
?>
<div class="span-12">
<?php echo $this->renderPartial('//autorizacao/admin', array('model' => new Autorizacao())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//entidadeRedeHotspots/admin', array('model' => new EntidadeRedeHotspots())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//estadoObra/admin', array('model' => new EstadoObra())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//fabricantes/admin', array('model' => new Fabricantes())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//operadores/admin', array('model' => new Operadores())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//tiposOperadores/admin', array('model' => new TiposOperadores())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//status/admin', array('model' => new Status())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//publicidade/admin', array('model' => new Publicidade())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//ssids/admin', array('model' => new Ssids())); ?>
</div>
<div class="span-12">
<?php echo $this->renderPartial('//tiposDispositivos/admin', array('model' => new TiposDispositivos())); ?>
</div>
<script>
$(document).ready(function() {
$('.addnew').append('<?php echo $this->getUniqueId();?>');
});
</script>
if i use
<script>
$('.addnew').append('<?php echo $this->getUniqueId();?>');
</script>
inside one partial always get the parent controller name…
CGridColumn.php
protected function renderFilterCellContent()
{
echo '<button class="btn-small btn-success addnew">Novo</button>'.Yii::app()->getController()->getId();
echo $this->grid->blankDisplay;
}
just to add a addnew link with the proper path.
thanks i did it with $this->grid->dataProvider->getId()