문제

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