ej.grids.Grid.Inject(ej.grids.DetailRow, ej.grids.Edit, ej.grids.Toolbar);
var grid = new ej.grids.Grid({
dataSource: clubData,
allowPaging: false,
allowGrouping: false,
allowSorting: false,
allowPdfExport: false,
allowExcelExport: false,
actionFailure: failure,
toolbar: ['Search'],
sortSettings: { columns: [{ field: 'name', direction: 'Ascending' }] },
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal' },
columns: [
{ field: 'clubid', headerText: 'ID', width: 120, textAlign: 'Right', visible: false, isPrimaryKey: true },
{ field: 'name', headerText: '<?=Yii::t('app', 'Club Name')?>', width: 120, textAlign: 'Left' },
{ field: 'zipcode', headerText: '<?=Yii::t('app', 'Zip')?>', width: 130, textAlign: 'Right' },
{ field: 'city', headerText: '<?=Yii::t('app', 'City')?>', width: 130, textAlign: 'Right' },
{ field: 'street', headerText: '<?=Yii::t('app', 'Street')?>', width: 130, textAlign: 'Right' },
],
childGrid: {
dataSource: clubcontactData,
queryString: 'clubid',
actionFailure: failure,
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal' },
columns : [
{ field: 'clubcontactid', headerText: 'ID', width: 120, textAlign: 'Right', visible: false, isPrimaryKey: true },
{ field: 'type', headerText: '<?=Yii::t('app', 'Typ')?>', width: 120, textAlign: 'Left', editType: 'dropdownedit', edit: {params: {foreignKeyField: "id", foreignKeyValue: "text", dataSource: contacttypes, fields: {value: 'value', text: 'text'}, placeholder: 'Select Type'}}},
{ field: 'name', headerText: '<?=Yii::t('app', 'Name')?>', width: 120, textAlign: 'Left' },
{ field: 'email', headerText: '<?=Yii::t('app', 'Email')?>', width: 120, textAlign: 'Left' },
{ field: 'mobile', headerText: '<?=Yii::t('app', 'Mobile')?>', width: 120, textAlign: 'Left' },
{ field: 'phone', headerText: '<?=Yii::t('app', 'Phone')?>', width: 120, textAlign: 'Left' },
],
},
});
grid.appendTo('#Grid');