neam / yii-relations-ui
简化 Yii 1 应用中关系的编辑
dev-develop
2015-04-29 14:06 UTC
Requires
- php: >=5.4.0
- neam/yii-handsontable-input: >=1.0.0
- neam/yii-relations-ui-core: *@dev
- yiisoft/yii: >=1.1.0
This package is not auto-updated.
Last update: 2024-09-24 01:36:01 UTC
README
简化 Yii 1 应用中关系的编辑。
当前小部件
基于 Handsontable 的多对一关系输入。
在 Yii 1 应用中如下使用
$this->widget('\neam\yii_relations_ui\widgets\HasManyHandsontableInput', [ 'model' => $model, 'relation' => 'routes', ]);
使用任何自定义列和 handsontable 设置
$this->widget('\neam\yii_relations_ui\widgets\HasManyHandsontableInput', [ 'model' => $model, 'relation' => 'routes', 'settings' => [ 'columns' => [ (object) ['data' => 'id'], (object) ['data' => 'route'], (object) ['data' => 'canonical', 'type' => 'checkbox', 'checkedTemplate' => 1, 'uncheckedTemplate' => 0], // example of using checkbox to save an attribute of type BOOLEAN NOT NULL (object) ['data' => 'route_type_id'], (object) ['data' => 'node_id'], (object) ['special' => 'delete_checkbox'], // special virtual column to mark which items should be deleted ] ] ]);
注意:此小部件需要 Yii <- Yii 2 桥接器,可在以下位置找到:https://github.com/neam/yii-yii2-bridge
截图 1 - 在 handsontable 中显示的多对一关系 "routes"
