Hello Jonis,

On Saturday 05 May 2007 Jonis wrote:
> Hi.
>
> How can i get data from selected item on listview (first colum)?
>
> i have this code:
>
> lv.getPane().addEventListener("dblclick", function(e) {
>                  //this.getManager().getSelectedItems()
>                  // or
>                  alert(this.getManager().getSelectedItem());
>    });
Your approach is right. With "getSelectedItem" you get a data item back. For 
example your defined your data like this:

var listColumns =
{
   name : { label : "Name", width : 100, type : "text" },
   size: { label : "Size", width : 50, type : "text", align : "right" },
   type : { label : "Type", width : 80, type : "text" },
   modified : { label : "Last Modified", width : 150, type : "text" },
   rights : { label : "Rights", width: 80, type : "text" }
};

and pushed your data like this into the ListView:

listData.push(
{ 
  name : { text : "File " + i }, 
  size : { text : Math.round(Math.random()*100) + "kb" },                  
  type : { text : lt[t] }, 
  modified : { text : "Nov " + Math.round(Math.random() * 30 + 1) + " 2005" }, 
  rights: { text : "-rw-r--r--" }
});


Then "this.getManager().getSelectedItem().name.text" would get you the text of 
the first column.

A litte hint: You can use "qx.io.Json.stringify" for the debug output of this 
data maps. 

this.debug(qx.io.Json.stringify(this.getManager().getSelectedItem()));

This should give you the content of the data item in a nice overview (defined 
in the eventlistener code).

cheers,
  Alex

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to