PDA

View Full Version : EXTJS 4 the getPath() function, another way to get it?



icebergdelphi
25 Apr 2013, 3:13 PM
Hi all, EXTJS 4 the getPath() function has vanished and I can't seem to find an equivalent in Node, Tree, or TreePanel.

I need it for the treepanel with a listener :


{ xtype: 'treepanel', store:store, viewConfig: { loadingText: 'Cargando' }, listeners: { selectionchange: function(tablepanel, selections, options) { alert( this.getSelectionModel().getSelection()[0].data.text); } } }



i just found the way with TreeStore:


var store = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: this.dataUrl, reader: { type: 'json', root: 'data', record:'' }, actionMethods: { read: 'POST' } }, listeners: { beforeload: function(store, operation, options){ store.proxy.extraParams.action= 'get-folders', store.proxy.extraParams.path=operation.node.getPath('text'); //<----Works great } }, sorters: [{ property: 'leaf', direction: 'ASC' },{ property: 'text', direction: 'ASC' }], root: { text: 'Root', id: 'src', expanded: true } });

But i need to find the path node in treepanel.
Any ideas?

Thanks.:s

icebergdelphi
25 Apr 2013, 3:22 PM
:s I response myself :



alert( this.getSelectionModel().getSelection()[0].getPath('text'));


resolved Thanks.