Question

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.

Was it helpful?

Solution

Try to set keyField of dataProvider to 'id'.

dataProvider->keyField ='id';

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top