I am using x-editable to use inline editing in CGridview. http://x-editable.demopage.ru/index.php I am using postgresql as the database. The problem is that I am using functions in postgres to write queries and I am calling those functions from yii. The data provider I am using is CSqlDataprovider. So while using the inline edit the data-pk attribute is not showing in the grid view. So the update is not working. Please help.

有帮助吗?

解决方案

Try to set keyField of dataProvider to 'id'.

dataProvider->keyField ='id';

其他提示

You can specify the PK has a param in your X-editable column:

$this->widget('editable.EditableField', array(
    'type'         => 'select',
    'model'        => $data,
    'attribute'    => 'user_status',
    'url'          => $this->createUrl('site/updateUser'),
    'pk'           => 'id',
    ));

?>

If you want more details, then provide us more information about your CgridView column and data that need to be saved.

Source

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top