Results 1 to 3 of 3

Thread: multiselect for treegrid

  1. #1
    Sencha Premium Member fl.borovsky's Avatar
    Join Date
    Jul 2013
    Posts
    89
    Answers
    6

    Default multiselect for treegrid

    On ExtJS5 kitchen sink we can see an example of using multiselect list with grid. Is there any possibility to act multiselect as a tree to select items for grid?
    In ExtJS4 we manually programmed similar behaviour:
    6ad6ffb53c4a536266b636a3b63e2d70.png

  2. #2
    Sencha - Services Team Stju's Avatar
    Join Date
    Dec 2008
    Location
    Redwood city, California
    Posts
    293
    Answers
    2

    Default

    As the question was really vague, here is the code to get checkboxes on tree component.
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true,checked:true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true,checked:true },
                    { text: "algebra", leaf: true,checked:true}
                ] },
                { text: "buy lottery tickets", leaf: true,checked:true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 250,
        store: store,
        rootVisible: false,
        renderTo: Ext.getBody()
    });
    If you would like to make any changes to the grid on the right side, you have to listen for: http://docs.sencha.com/extjs/5.0.0/a...nt-checkchange event.

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Will point out the checked key in the data (in the children) is the key.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •