Hello!
I am very new to Yii, but am starting to get the hang of it (I think ) - That said, I recently discovered and have been playing with YiiBooster. In-line (or pop-up) editing in a grid was something I wanted since day 1! Everything is working great, except one thing. I have a column that contains a URL. What I’m hoping to do is have the user, in the SAME box, be able to click the link and it opens, or edit the URL. There are a few ways I have thought of, but my favorite is to have the editable field, and then next to it, have an icon/button that pops up a new window. I can’t figure out how to do this without being REALLY messy… and I can’t image I am the first to think of this… I have thought of some “acceptable” alternatives (like a button at the top of the grid that enables editing, and therefor the link is able to be clicked before; an icon right next to url that enable editing), but I haven’t been able to find a way to easily do this. Nothing special, but here is the code I am working with:
$this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'condensed striped',
'itemsCssClass'=>'table table-striped table-bordered table-hover',
'id'=>'clientnote-grid',
'template'=>'{items}',
'dataProvider' => $dataProvider,
'columns'=>array(
array(
'header' => 'Note Type',
'name'=> 'tbl_lookup_id',
'value' => '($data->tbl_lookup_id == null)?"None":$data->tblLookup->name',
'class'=>'bootstrap.widgets.TbEditableColumn',
'editable'=>array(
'type'=>'select',
'url'=>CHtml::normalizeUrl(array("lookupdata/updateField")),
'source'=> CHtml::listData(Lookup::model()->findAll('type = "Client Notes"'), 'id', 'name'),
'inputclass'=>'input-xlarge',
)
),
array(
'name'=> 'assocUrl',
'header' => 'URL',
'value' => '$data->assocUrl',
'type' => 'raw',
'class'=>'bootstrap.widgets.TbEditableColumn',
'editable'=>array(
'type'=>'text',
'url'=>CHtml::normalizeUrl(array("lookupdata/updateField")),
'inputclass'=>'input-xlarge',
'emptytext' => 'none',
)
),
)));
Thank you for your time!
Bill Bushong