Hi Team,
I am using cascading dropdown list in angular ejs-grid . I have achieved that functionality using below link
My Question is like,
How to bind the values in dropdown list when user doing Edit operation in the grid ?
For Ex , I have a below grid , see the first record where Ship country is Australia and Ship state is Queensland (Ship State dropdown loaded based on selected country)
once I edit that record the dropdown values are getting cleared and asking user to select it again as see below,
I need the solution for , when user clicks on Edit button the dropdown should bind the actual value for Ship country (Australia) and Ship State (Queensland) , instead of clearing the both dropdowns . How to achieve this ?
Thanks
Nambi R
|
// Edit params for first dropdown
this.countryParams = {
write: (args) => {
this.countryObj = new DropDownList({
dataSource: this.country,
// Current value is set as dropdown’s selected text
text: args.rowData[args.column.field],
fields: { value: 'countryId', text: 'countryName' }
.
.
});
this.countryObj.appendTo(this.countryElem);
}
};
// Edit params for second dropdown
this.stateParams = {
write: (args) => {
this.stateObj = new DropDownList({
dataSource: this.state,
// Current value is set as dropdown’s selected text
text: args.rowData[args.column.field],
fields: { value: 'stateId', text: 'stateName' },
.
.
});
this.stateObj.appendTo(this.stateElem);
}
} |