PDA

View Full Version : Ext4 Combo Box selectedRecord



asulhyan
10 Oct 2012, 1:46 PM
What is alternative way in Ext 4 to get the selected item on Keyup / Keydown. I intend to override it so that on Keyup/Keydown the value of the selection get put in the box.

In Ext 2.*


var index = this.view.getSelectedIndexes()[0];
var r = this.store.getAt(index);

Elfayer
10 Oct 2012, 11:34 PM
If there is only one selection :

var selection = this.getSelectionModel().getSelection()[0];
or multiple:

var selection = this.getSelectionModel().getSelection();

asulhyan
11 Oct 2012, 6:03 AM
thanks but I think you meant


this.getPicker().getSelectionModel().getSelection()[0]


But this object does get filled on "select" event; that was part of the problem. Is there a way I can fire a event or add a pointer where a up/down event will move the select element accordingly. I am doing it on "specialkey" listener where I want to check the keyup/keydown event and get the selected attribute on the up/down event

asulhyan
11 Oct 2012, 9:51 AM
I found what I was doing was incorrect. I need to use the store for my lookup. So, keeping track of counters on Key up/down, using min and max records; I was able to move the pointer like a doubly linkedlist

How to get from store and setting the value


rec = dealSrchLvBoxCmp.getStore().getAt(dealSrch.liveBoxEvCnt);
dealSrchLvBoxCmp.setValue( rec.get( 'name' ) );