Hello Tuebben
If you don't want to search in array, you can use userData property in
widgets. Some times is more fast than searching arrays.
var _selectBox = new qx.ui.form.SelectBox();
for (var _i = 0; _i < 10; ++_i) {
var _listItem = new qx.ui.form.ListItem("Item " + _i);
_listItem.setUserData('index', _i);
_selectBox.add(_listItem);
}
_selectBox.addListener("changeSelection", function(e) {
alert(
'Using getData: ' + e.getData()[0].getUserData('index') + '\n' +
'Using getSelection: ' + _selectBox.getSelection()[0].getUserData('index')
);
});
Regards
Joaquin F.
2013/6/24 tuebben <[email protected]>:
> Hello Derrell,
>
> selectBox.getChildren().indexOf(evt.getData()) always returns -1
>
> selectBox.getChildren().indexOf(selectBox.getSelection()[0]) does work for
> me.
>
> Thanks for pointing me to the solution!
>
> Greetings ... Peter
>
>
>
> -----
> Sorry for my weird english
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Get-selected-index-from-qx-ui-form-SelectBox-tp7583908p7583927.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel