XULCustomTree cell image src

Ask questions about SiteFusion and application development

XULCustomTree cell image src

Postby Abbadon1334 » 26 Feb 2010, 14:39

hi,

in a normal XULTree i insert an image in a XULTreeCell like this :

Code: Select all

while($obj = $this->db->fetch_object($res)) {
            
   $children[] = new XULTreeItem(
         new XULTreeRow(
            new XULTreeCell($obj->IDBanca),
            new XULTreeCell($obj->Banca),
            new XULTreeCell("http://www.google.it/images/nav_logo7.png")
         )
      );
   }
         
   $this->treeChildren->addChild($children);



but in XULCustomTree how can i do that?
Abbadon1334
 
Posts: 35
Joined: 15 Feb 2010, 04:42
Location: Florence, Italy | Ploiesti, Romania

Re: XULCustomTree cell image src

Postby nikkiauburger » 26 Feb 2010, 20:57

Hi,

this is currently not implemented, but will be included in the next release which should be due in the next week or two. Right now only the column indicated as primary can have an image which can be set through the property TreeDataRow::$primaryImage
nikkiauburger
 
Posts: 36
Joined: 21 Sep 2009, 00:07

Re: XULCustomTree cell image src

Postby Abbadon1334 » 26 Feb 2010, 21:00

i waiting :)

Good work!
Abbadon1334
 
Posts: 35
Joined: 15 Feb 2010, 04:42
Location: Florence, Italy | Ploiesti, Romania

Re: XULCustomTree cell image src

Postby nikkiauburger » 03 Mar 2010, 14:37

Just to notify you, this feature has been added in trunk. Release 5.2.1 will be due probably this week or next week, but if you want to use it right away you can download the trunk version through Subversion (see the installation tutorial). It works like this:

a primary image can still be set through TreeDataRow::primaryImage( $src )
now you can also set an image for any kind of cell (either in combination with text/checkbox/progressmeter or alone) with the function TreeDataRow::setImage( $column, $src ), where $column is the name of the column and $src the path or url to the image.

By the way, I don't know if this is clear from the documentation but if an image src starts with a / it's assumed to be relative to the sitefusion root. So if you want to show the image stored in app/yourapp/myimage.png, your $src would be '/app/yourapp/myimage.png'. This counts for XULImage and the likes as well. Only XULFileSystemImage accepts absolute system paths.
nikkiauburger
 
Posts: 36
Joined: 21 Sep 2009, 00:07

Re: XULCustomTree cell image src

Postby Abbadon1334 » 03 Mar 2010, 18:12

By the way, I don't know if this is clear from the documentation but if an image src starts with a / it's assumed to be relative to the sitefusion root. So if you want to show the image stored in app/yourapp/myimage.png, your $src would be '/app/yourapp/myimage.png'. This counts for XULImage and the likes as well. Only XULFileSystemImage accepts absolute system paths.


This is really precious!

So, we are working full time and testing so much as possible to see if SiteFusion is the right way to choose/proceed in our project, at now it's the best solution we have try.Sure, when we know much better sitefusion, we try to help too.

Good work, Guys!

Francesco

http://www.oracoltech.com
Abbadon1334
 
Posts: 35
Joined: 15 Feb 2010, 04:42
Location: Florence, Italy | Ploiesti, Romania

Re: XULCustomTree cell image src

Postby Gerard » 15 Apr 2010, 09:37

heres an example for the image in the cell (being somewhat an indicator image instead of a standalone image)
Code: Select all
$rowToInput = array(
       'column1' => ' random value '
);
$dataSetRow->createRow($rowToInput);
$dataSetRow->setImage('column1' , '/relative/path/to/image.jpg');
$dataSet->addRow($dataSetRow);


This is a simple way of putting an image in front of the value
hope it helps

Gerard
you cant destroy what you did not create... or atleast thats what they say (A)
Gerard
 
Posts: 1
Joined: 30 Mar 2010, 10:16


Return to General Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron