You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$data->primaryKey is null when constructing the ajax request url,
when change to $data["id"],it works!
In CSqlDataProvider i have set the "keyField" to "id", is it a bug that you always use $data->primaryKey to create the url, in fact $data does have a field call "primaryKey", how can you get the value of it? -- it's just an array of assicative array, which does not have any information about which attribute is the primarykey!
you should have a attribute for us to specify the id attribute name - $idAttr ,
and use it in initButton method like this : $this->button = array( 'url' => 'Yii::app()->controller->createUrl("' . $this->toggleAction . '",array("pk"=>$data[' . $this->idAttr . '],"attribute"=>"' . $this->name . '"))', 'htmlOptions' => array('class' => $this->name . '_toggle' . $this->uniqueClassSuffix), );
The text was updated successfully, but these errors were encountered:
$data->primaryKey is null when constructing the ajax request url,
when change to $data["id"],it works!
In CSqlDataProvider i have set the "keyField" to "id", is it a bug that you always use $data->primaryKey to create the url, in fact $data does have a field call "primaryKey", how can you get the value of it? -- it's just an array of assicative array, which does not have any information about which attribute is the primarykey!
you should have a attribute for us to specify the id attribute name - $idAttr ,
and use it in initButton method like this :
$this->button = array( 'url' => 'Yii::app()->controller->createUrl("' . $this->toggleAction . '",array("pk"=>$data[' . $this->idAttr . '],"attribute"=>"' . $this->name . '"))', 'htmlOptions' => array('class' => $this->name . '_toggle' . $this->uniqueClassSuffix), );
The text was updated successfully, but these errors were encountered: