Hello, Team
I want to add an edit template in child grid.
When it add in the child grid, i want to give browse button to select itemnum
Same like below image
Please share example in vue.
|
[App.vue]
let elem;
let datePickerObj;
let searchiconclick = function (args) {
// do your action here
};
------
childGrid: {
dataSource: orderDatas,
queryString: "EmployeeID",
allowPaging: true,
toolbar: ["Add", "Edit", "Delete", "Update", "Cancel"],
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
},
pageSettings: { pageSize: 6, pageCount: 5 },
columns: [
{
field: "OrderID",
headerText: "Order ID",
isPrimaryKey: true,
textAlign: "Right",
width: 120,
},
{ field: "ShipCity", headerText: "Ship City", width: 120 },
{ field: "Freight", headerText: "Freight", width: 120 },
{
field: "ShipName",
headerText: "Ship Name",
edit: {
create: function () {
elem = document.createElement("input");
return elem;
},
read: () => {
return elem.value;
},
destroy: () => {
elem.remove();
},
write: function (args) {
// create the span element
var span = document.createElement("span");
// add class to the span element to show search icon
span.classList.add("e-icons", "searchicon");
args.element.closest("td").appendChild(span);
// set the margin
span.style.margin = "-20px";
// add click event
span.addEventListener("click", searchiconclick);
// bind cell value to the input element
args.element.value = args.rowData[args.column.field];
},
},
width: 150,
},
],
},
------
<style>
.searchicon::before {
content: "\e993"; // bind the icon to the class
}
</style>
|
|
[app.vue]
write: function (args) {
autoCompleteObj = new AutoComplete({
//bind the data manager instance to dataSource property
dataSource: orderDatas,
value: args.rowData[args.column.field],
//map the appropriate columns to fields property
fields: { value: "ShipName" },
});
autoCompleteObj.appendTo(args.element);
}
|