Note that there are some explanatory texts on larger screens.

plurals
  1. POQuery String value is missing in update icon : CGridView (Yii)
    primarykey
    data
    text
    <p>I'm using Yii , In CGridView if I click update icon, nothing is comming (in quwey string) after <code>id=</code></p> <pre><code>URL?r=employes/update&amp;id= </code></pre> <p>View</p> <pre><code>&lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array( 'id'=&gt;'employee-grid', 'dataProvider'=&gt;$model-&gt;EmpList(), 'columns'=&gt;array( 'employee_no', .... 'date_created', array( 'class'=&gt;'CButtonColumn', 'template'=&gt;'{update} {delete}', ), ), )); ?&gt; </code></pre> <p>What is the problem? </p> <p><hr> controller</p> <pre><code> public function actionIndex() { // here is your code for this action $model = new Emp; // print_r ($_POST); if(isset($_POST['Emp'])) { .. .. $connection = Yii::app()-&gt;db2 ; //Connect with 2nd db. .. .. $command1 = 'Insert Query' // Insert Query here $cmd1 = $connection-&gt;createCommand($command1); $cmd1-&gt;execute(); } $this-&gt;render('index', array( 'model'=&gt;$model, 'id'=&gt;$model-&gt;extension, )); } public function actionUpdate($id) { $model=$this-&gt;loadModel($id); // Uncomment the following line if AJAX validation is needed // $this-&gt;performAjaxValidation($model); if(isset($_POST['Emp'])) { $model-&gt;attributes=$_POST['Emp']; if($model-&gt;save()) $this-&gt;redirect(array('view','id'=&gt;$model-&gt;emp_id)); } $this-&gt;render('update',array( 'model'=&gt;$model, )); } </code></pre> <p>model</p> <pre><code>class Emp extends DB2 { public function getDbConnection() { //return self::getCCDbConnection(); return Yii::app()-&gt;dbcc; } .. .. .. public function ExtensionList() { $criteria=new CDbCriteria; $criteria-&gt;select='emp_id,emp_type,..date_created'; $criteria-&gt;condition = "emp_type = 'USER'"; return new CActiveDataProvider($this, array( 'criteria'=&gt;$criteria, 'pagination' =&gt; array( 'pageSize' =&gt; 5 ), )); } .. .. .. } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload