PDA

View Full Version : how to get nestedlist selected value?



wakatanka
4 Jul 2010, 5:10 AM
Hi , i've a layout with 2 list:
1 for tipology:


this.navigationPanel = new Ext.NestedList({
id: "listan",
items: [{
text: 'anelli-dia-solitario',
value: 'anelli-dia-solitario'
},
{
text: 'anelli-dia-eternelle',
value: 'anelli-dia-eternelle'
},
{
text: 'anelli-dia-trilogy',
value: 'anelli-dia-trilogy'
}],......

and 1 for price:


this.navigationPanel2 = new Ext.NestedList({
id: "listaprezzi",
items: [{
text: '(01) 0-300',
value: '(01) 0-300'
},
{
text: '(02) 300-600',
value: '(02) 300-600'
},
{
text: '(03) 600-900',
value: '(03) 600-900'
},
...

when i select a value on list 1, i fire a listener that make an ajax request.
My problem is that when i make the ajax request i need also the list2 value, to pass as a variable.
How can i get the list2 value?

thanks

wakatanka
6 Jul 2010, 8:03 AM
Please help me : (

TommyMaintz
6 Jul 2010, 10:30 AM
You are using a NestedList. A NestedList doesnt really have a "selected" value. If you would use regular Lists you could use getSelectedRecords() on it.

aconran
8 Sep 2010, 11:49 AM
NestedList has been refactored as of 0.94 to use Ext.List's.

You can now get the active record like so:


var record = nestedList.getActiveItem().getSelectedRecords()[0];