|
actionComplete(args) {
// Set initail Focus
if (args.requestType === "beginEdit") {
args.form.elements.namedItem("CustomerID").focus();
}
if (args.requestType === "beginEdit" || args.requestType === "add") {
// set buttons here....
args.dialog.buttons = [
{
buttonModel: {
isPrimary: true,
content: "Save",
iconCss: "e-icons e-ok-icon"
},
click: this.saveBtnClick
},
{
buttonModel: {
isPrimary: true,
content: "Cancel",
iconCss: "e-icons e-close-icon"
},
click: this.cancelBtnClick
},
{
buttonModel: {
isPrimary: true,
content: "Save To file",
iconCss: "e-icons e-close-icon"
},
click: this.saveToFileBtnClick
},
{
buttonModel: {
isPrimary: true,
content: "Move Up",
iconCss: "e-icons e-close-icon"
},
click: this.moveUpBtnClick
},
{
buttonModel: {
isPrimary: true,
content: "Move Down",
iconCss: "e-icons e-close-icon"
},
click: this.moveDownBtnClick
}
];
}
},
saveBtnClick(args) {
this.$refs.gridObj.endEdit(); // perform actions here.
},
cancelBtnClick(args) {
this.$refs.gridObj.closeEdit(); // perform actions here.
},
saveToFileBtnClick(args) {
console.log("file saved"); // perform actions here.
},
moveUpBtnClick(args) {
console.log("move up"); // perform actions here.
},
moveDownBtnClick(args) {
console.log("move down"); // perform actions here.
} |
|
<ejs-grid
ref="gridObj"
. . . . . . .
:toolbar="toolbar"
:toolbarClick="clickHandler"
height="273px"
>
toolbar: [ "Add", "Edit","Delete","Update", "Cancel", {
text: "Dialog",
tooltipText: "Custom Dialog",
prefixIcon: "e-expand",
id: "dialog"
}
]
clickHandler(args) {
if (args.item.id === "dialog") {
this.$refs.gridObj.selectRow(0);
this.$refs.gridObj.startEdit();
}
} |