Page 1 of 1

[REACT] Want to display the nested list in dropdown

Posted: Fri Mar 31, 2023 11:37 am
by omkar ankam

As I want to display the list in a dropdown that list will contain another list for a specific row.

for example
None
1.Default
a) None
2.Marketing
a) SE
b)BI
3)PD
a)TL
b)ASE
c)SSE

Thanks
Omkar


Re: [REACT] Want to display the nested list in dropdown

Posted: Fri Mar 31, 2023 12:47 pm
by tasnim

Hi Omkar,

Are you looking for something like this

Screenshot 2023-03-31 164645.png
Screenshot 2023-03-31 164645.png (12.5 KiB) Viewed 452 times

Docs
https://bryntum.com/products/gantt/docs/api/Core/widget/Menu


Re: [REACT] Want to display the nested list in dropdown

Posted: Fri Mar 31, 2023 1:07 pm
by omkar ankam

Hi tasnim

I want to create something like this

gantt.PNG
gantt.PNG (8.97 KiB) Viewed 449 times

Re: [REACT] Want to display the nested list in dropdown

Posted: Fri Mar 31, 2023 3:31 pm
by tasnim

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
function2.PNG (1.59 KiB) Viewed 416 times
Function1.PNG
Function1.PNG (4 KiB) Viewed 416 times
Function.PNG
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
gantt.PNG (10.13 KiB) Viewed 385 times

Re: [REACT] Want to display the nested list in dropdown

Posted: Tue Apr 04, 2023 3:51 pm
by mats

Looks like you misspelt "inputField"