Re: [REACT] Want to display the nested list in dropdown
Posted: Mon Apr 03, 2023 2:44 pm
by omkar ankam
Can you just help me with the code why the data is coming as blank in UI whereas I am able to see data in the console.
function2.PNG (1.59 KiB) Viewed 416 times
Function1.PNG (4 KiB) Viewed 416 times
Function.PNG (4.47 KiB) Viewed 416 times
Re: [REACT] Want to display the nested list in dropdown
Posted: Mon Apr 03, 2023 6:40 pm
by marcio
Hey omkar ankam,
Could you please share how did you configure your picker? If you check the example that Tasmin shared, you'll see that we have a combo configured just like you mentioned you need, like this:
class CityModel extends Model {
static idField = 'name';
static fields = [
'name',
'region'
];
}
const cityCombo = {
type : 'combo',
valueField : 'name',
displayField : 'name',
cls : 'city-combo',
chipView : {
iconTpl : () => '<i class="b-icon b-fa-city"></i>'
},
listItemTpl : ({ name }) => `<i class="b-icon b-fa-city"></i>${name}`,
picker : {
cls : 'city-list',
allowGroupSelect : false
},
store : {
modelClass : CityModel,
groupers : [
{ field : 'region', ascending : true }
],
data : [
{ name : 'Stockholm', region : 'Europe' },
{ name : 'Barcelona', region : 'Europe' },
{ name : 'Paris', region : 'Europe' },
{ name : 'Dubai', region : 'Middle East' },
{ name : 'Istanbul', region : 'Middle East' },
{ name : 'Riyadh', region : 'Middle East' },
{ name : 'New York', region : 'US' },
{ name : 'San Francisco', region : 'US' },
{ name : 'Washington', region : 'US' },
{ name : 'Moscow', region : 'Russia' },
{ name : 'St Petersburg', region : 'Russia' }
]
}
};
Re: [REACT] Want to display the nested list in dropdown
Posted: Tue Apr 04, 2023 1:36 pm
by omkar ankam
gantt.PNG (10.13 KiB) Viewed 385 times
Re: [REACT] Want to display the nested list in dropdown