|
[html page]
<ejs-grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
. . .
<e-column field='Discontinued' headerText='Ship Country' width='150' editType='dropdownedit' type="boolean" displayAsCheckBox='true' [edit]='ddParams'></e-column>
</e-columns>
</ejs-grid>
[ts file]
export class NormalEditComponent implements OnInit {
public data: Object[];
. . .
public ddParams: IEditCell;
public ngOnInit(): void {
this.data = productData;
. . .
this.ddParams = {
create: () => {
this.elem = document.createElement('input');
return this.elem;
},
read: () => {
return this.dropdownObj.value;
},
destroy: () => {
this.dropdownObj.destroy();
},
write: (args: { rowData: Object, column: Column }) => {
. . .
this.dropdownObj = new DropDownList({
// set the local data to dataSource property
dataSource: data,
// map the appropriate columns to fields property
fields: { text: 'Value' },
// set the value to DropDownList
value:"true",
// set the height of the popup element
popupHeight: '200px'
});
this.dropdownObj.appendTo(this.elem);
} |
|
<ejs-grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
. . .
<e-column field='Discontinued' headerText='Ship Country' width='150' type="boolean" displayAsCheckBox='true' ></e-column>
</e-columns>
</ejs-grid> |