...
write:()=>{
this.countryObj = new DropDownList({
dataSource: this.country,
fields: { value: 'countryId', text: 'countryName' },
change: (args:any) => {
let inputelem: any = document.getElementById(this.grid.element.id + "CustomerID").parentNode;
if(this.countryObj.text == "Australia") {
inputelem.classList.add("e-disabled")
}
else if(this.countryObj.text == "United States" && inputelem.classList.contains("e-disabled")) {
inputelem.classList.remove("e-disabled");
inputelem.firstElementChild.classList.remove("e-disabled");
inputelem.firstElementChild.removeAttribute("disabled");
inputelem.firstElementChild.type = 'number';
}
this.stateObj.enabled = true;
let tempQuery: Query = new Query().where('countryId', 'equal', this.countryObj.value);
this.stateObj.query = tempQuery;
this.stateObj.text = null;
this.stateObj.dataBind();
},
placeholder: 'Select a country',
floatLabelType: 'Never'
});
this.countryObj.appendTo(this.countryElem);
}
... |
...
if(this.countryObj.text == "Australia") {
inputelem.classList.add("e-disabled")
}
else if(this.countryObj.text == "United States" && inputelem.classList.contains("e-disabled")) {
...
inputelem.firstElementChild.type = 'number'; //set type to the input element
}
... |
<mat-tab-group>
<mat-tab label='tab1'>
<ng-template matTabContent>
<default1-content></default1-content>
</ng-template>
</mat-tab>
<mat-tab label='tab2'>
<ng-template matTabContent>
<default2-content> </default2-content>
</ng-template>
</mat-tab>
</mat-tab-group> |
<ejs-grid #grid height="400" id="grid"
[columns]='columns1'
[selectedRowIndex]="20"
[dataSource]='dataSource1'
[allowSelection]='true'>
</ejs-grid> |
<ejs-grid #grid1 height="400" id="grid1"
[columns]='columns3'
[selectedRowIndex]="20"
[dataSource]='dataSource3'
[allowSelection]='true'>
</ejs-grid> |
App.component.ts
write: (args) => {
this.dropData.push(args.rowData.ShipCountry); // push the value to the dropdownlist datasource
this.formatObj = new DropDownList({
dataSource: this.dropData,
fields: { value: 'idFormat', text: 'format' },
value: args.rowData.ShipCountry, //assigned the value to the dropdownList
});
|