TreePanel - Multiple Selections [SOLVED]

January 6th, 2009
  • I'm having issues with a TreePanel... it seems the most recently selected item doesnt appear in the array fetched by tree.getSelectionMode().getSelectedNodes() in a click listener... is there an alternative listener that fires only after the selected nodes have been updated


    listeners: {
    click: function(n) {
    var nodes = tree.getSelectionModel().getSelectedNodes();
    var selections = Array();
    var i = 0;
    for (key in nodes) {
    selections[i] = nodes[key].id; i++;
    }
    var selectedjson = Ext.util.JSON.encode(selections);
    mainData.load({
    params: {
    sites: selectedjson
    }
    })
    }
    },

    selectedjson only ever contains the elements selected *before* the most recent


  • I'd tried that before and it didnt work however I'd applied it as a listener to the TreePanel itself not the selectionModel... works great now thanks.


  • Why not use the selectionchange (http://extjs.com/deploy/dev/docs/?class=Ext.tree.MultiSelectionModel&member=selectionchange) listener?







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about TreePanel - Multiple Selections [SOLVED] , Please add it free.