I have been working on yii infrastructure for the last 10 days. I have done a lot in my project, but I am stuck in one problem. in the following table, when I click any row, it should get the data of the selected row in the jquery dialog, and it should open when the edit button on the table toolbar is clicked. 
as an example, when I click on any line in the listed lines, then it should stand out, and if I click the edit button, it should open a dialog form with the selected row data. here is my code .....
<table class="display" id="dt3"> <ul class="table-toolbar"> <li><a href="#" id="create-user"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icons/basic/plus.png" alt="" /> Add</a></li> <li><a href="#"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icons/basic/delete.png" alt="" /> Delete</a></li> <li><a href="#" id="create-user2"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icons/basic/edit.png" alt="" /> Edit</a></li> </ul> <ul> <table class="display" id="dt4"> <tr> <?php $dataProvider=new CActiveDataProvider('Station'); $this->widget('zii.widgets.grid.CGridView', array ( 'dataProvider'=>$dataProvider, 'itemsCssClass'=>'display', 'summaryText'=>'', 'rowCssClass'=>array('odd gradeX','even gradeC'), 'htmlOptions'=>array('class'=>'display'), 'columns'=>array( array ( 'name'=>'Station Name', 'value'=>'$data->Station_Name', ), array ( 'name'=>'Status ', 'value'=>'$data->Status_value', ), array ( 'name'=>'Description ', 'value'=>'$data->Station_Description', ), array ( 'name'=>'Order ID ', 'value'=>'$data->OrderID', ), array ( 'name'=>'Updated By ', 'value'=>'$data->Updated_by', ), ), ) ); ?> </tr> </table> </ul> </table> <div id="dialog-form" title="Add/Edit Station" class="box-content" style="height: 100px"> <form action="index.php?r=setting/stations" method="POST"> <div class="form-row"> <label class="form-label">Station Name</label> <div class="form-item"> <input type="text" name="station_name" /> </div> </div> <div class="form-row"> <label class="form-label">Description</label> <div class="form-item"> <input type="text" name="station_description"/> </div> </div> <div class="form-row"> <label class="form-label">Order Id</label> <div class="form-item"> <input type="text"name="order_Id" /> </div> </div> <div class="form-row"> <label class="form-label">Updated By</label> <div class="form-item"> <input type="text" name="updated_by" /> </div> </div> <ul style="float:right;"> <li style="float:right;"><a href="#"><input type="submit" class="button small green" value="Add Station"></a></li> </ul> </form> </div>
source share