- Home
- Forum
- React - EJ 2
- Grid DropDown
Grid DropDown
Hi,
In my application i have two drop down in grid, i want to render other drop down value based on first drop selection how i can do so? Do we have an example for grid dropdown for above scenario? Do we have onchange method for grid dropdown?
SIGN IN To post a reply.
3 Replies
HJ
Hariharan J V
Syncfusion Team
June 11, 2019 09:23 AM UTC
Hi Sandeep,
Thanks for contacting us.
Please refer the below example to achieve cascading dropdown on grid.
https://ej2.syncfusion.com/react/documentation/grid/how-to/cascading-drop-down-list-with-grid-editing/
Regards,
Hariharan
Thanks for contacting us.
Please refer the below example to achieve cascading dropdown on grid.
https://ej2.syncfusion.com/react/documentation/grid/how-to/cascading-drop-down-list-with-grid-editing/
Regards,
Hariharan
LA
License Admin
July 17, 2019 01:11 PM UTC
Hi Hariharan,
Thanks,
But here say for example i am adding a new column and selecting country as UnitedStates that specfic state fields are shown but when i select Australia it is still showing UnitedState states. so how can we avoid that?
SS
Seeni Sakthi Kumar Seeni Raj
Syncfusion Team
July 18, 2019 12:47 PM UTC
Hi Sandeep,
Thanks for the update.
We can set the null value to the state handling dropdownlist while changing the dataSource value to them. Refer to the following code example.
|
this.countryParams = {
create: () => {
this.countryElem = document.createElement('input');
return this.countryElem;
},
destroy: () => {
this.countryObj.destroy();
},
read: () => {
return this.countryObj.text;
},
write: (args) => {
let data = this.country.filter((e) => {
return e.countryName == args.rowData[args.column.field];
});
this.countryObj = new DropDownList({
change: () => {
this.stateObj.enabled = true;
const tempQuery = new Query().where('countryId', 'equal', this.countryObj.value);
this.stateObj.query = tempQuery;
this.stateObj.text = '';
this.stateObj.value = null;
this.stateObj.dataBind();
},
dataSource: new DataManager(this.country),
fields: { value: 'countryId', text: 'countryName' },
floatLabelType: 'Never',
value: data[0].countryId,
placeholder: 'Select a country'
});
this.countryObj.appendTo(this.countryElem);
}
}; |
Regards,
Seeni Sakthi Kumar S.
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
LA License Admin
- Jun 10, 2019 01:26 PM UTC
- Jul 18, 2019 12:47 PM UTC