|
Your Code:
var batch_detail_batch = [].slice
.call(editform.inputElements)
.filter(x => x.getAttribute("name") === "batch_detail_batch")[0];
-----
batch_detail_batch.enabled = false; // not working
Modified Code:
// get the input element using name attribute and tagname
var batch_detail_batch1 = [].slice
.call(editform.inputElements)
.filter( x => x.getAttribute("name") === "CustomerName" &&x.tagName === "INPUT")[0];
// get the instances of element
batch_detail_batch1.ej2_instances[0].enabled = false;
|
|
var batch_detail_batch1 = [].slice.call(editform.inputElements).filter(
x =>
x.getAttribute("name") === "ShipCountry" &&
x.tagName === "INPUT" // use that condition to get the dropdown input element
)[0];
console.log("batch_detail_batch1");
console.log(batch_detail_batch1);
|
|
// get the grid id from its instances
var gridinsid = this.grid.element.id;
// get the grid is from editform element
var gridid = editform.element.id.split("EditForm")[0];
// get dropdown input element by using its id
var batch_detail_batch1 = editform.element.querySelector( "#" + gridid + "ShipCountry"); // “#” + grid element id + field name
|
|
if (e.value % 2 == 1) {
// get the instances of element
batch_detail_batch1.ej2_instances[0].enabled = false;
} else {
batch_detail_batch1.ej2_instances[0].enabled = true;
}
|