Re: clist:get_row_data
| From: | Gonzalo Monzón | Date: | Mon, 29 Nov 2004 16:41:08 +0000 |
| Subject: | Re: clist:get_row_data | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5273@lists.php.net to get a copy of this message | ||
Gonzalo Monzón wrote:
Oliver Hotz wrote:When you add the row: $row=$clist->append(...); You must add your "row data" with this simple call: $clist->set_row_data($row,"thats my row data"); Gonzalo Monzón.I just can't get it to work... this is what I have: function QueueSelectRow( $objPara1) { $row = $this->arWidgets["queueclist"]->selection[0]; // selected row $rowdata = $this->arWidgets["queueclist"]->get_row_data($row); var_dump($rowdata); } $row gets assigned correctly, its either 0 or 1, depending which of my 2 rows I select... however, $rowdata is always NULL :( Oliver -----Original Message----- From: Alan Knowles [mailto:alan@akbkhome.com] Sent: Sunday, November 28, 2004 10:28 PM To: oliver@heimlich.net Cc: php-gtk-general@lists.php.net Subject: Re: [PHP-GTK] clist:get_row_data Cant remember all the tricks on this, probably just be carefull you are using a reference to the row/list, rather than a copy (eg. =& rather than =) http://docs.akbkhome.com/phpmole/module_directory_viewer.html look for set_row_data /get_row_data Regards Alan Oliver Hotz wrote:Hi Oliver! I think your fault its that you're not getting the "$row" object, when you made your call :Is there anything special you need to do to make this work ? Doesn`t matter which row I query, my result is always NULL Thanks for any help$row = $this->arWidgets["queueclist"]->selection[0]; // selected row the var $row it is just the num. of the sel. row... no the row object. ie. row 0, 3, 45 ...To get the "truly" row object you must change the declare of the callback function: (the callback already sends you the object ref. but you aren't using it!)function QueueSelectRow( $objPara1, $clist_row)Then if you call: $rowdata = $this->arWidgets["queueclist"]->get_row_data($clist_row); You will get the data you have previously fetch to the clist then added the row...Gonzalo Monzón. But I realized that your code work well too... so maybe the fault is in the set_row_data ...