Hello all,
I try to use the widget qx.ui.ListView :

*** ListView creation and fill with data

var ld=[];
for (i=0;i<10;i++){
ld.push({
COL1 : { text : "TEST1" },
COL2 : { text : "TEST2"},
COL3 : { text : "TEST3" },
});
}
var lc = {
COL1 :  { label : "myCol1", width : 120, sortable: true, type : "text" },
COL2 : { label : "myCol2", width : 50, sortable: true, type : "text", align
: "center" },
COL3 :  { label : "myCol3", width : 80, type : "text" },
}
var lv = new qx.ui.listview.ListView(ld, lc);

*** Add event when people selected a row in the list view :

lv.getPane().getManager().addEventListener("changeSelection", function(e)
{....});

Why this complex syntax ? what do you think have in the furture, syntax like
this :
lv.addEventListener("changeSelection", function(e) {...}); ?

*** My Code to get data from the selected row :

var i=lv.getPane().getRelativeItemPosition(lv.getPane().getSelectedItem());
this.info(lv.getData()[i]["COL1"]["text"]);
this.info(lv.getData()[i]["COL2"]["text"]);

This code is working but is ugly, do you know an elegant way to get data
from a selected row ?

Cheers.

frederic
-- 
View this message in context: 
http://www.nabble.com/access-data-from-qx.ui.ListView-tf2331917.html#a6487585
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to