Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Tree View - Can I Set The Images Manually  (Read 8615 times)
Stephen T.
Posts: 114


« on: September 23, 2011, 03:39:56 pm »

I have a tree view where the view represents a company/branch network.

In the other tree views I've used, the 'node open', 'node closed' and 'leaf node' attributes as defined on the form worked ok., but for this current view, I simply want the parent to have an image and all children to have another image.

I can set 'node open' and 'node closed' to the image for the company and the 'leaf node' to the image for the branch, as only companies can have branches and I can't have a branch with their being a company record. BUT, if I have a company without any branches, then that is a leaf and gets the wrong image (ie a branch and a company without any branches are shown with the same image).

I had half expected that the 'image' phantom field in the 4gl program array could be used to set the images. IE when loading the array I could set the image array field to a company image if a company, and to a branch image if a branch and then not bother setting the image attributes on the form, but that just seems to leave the image field blank.

Is there a way to do what I'm trying to do - ie simply set a parent node with one image, and a child node with another?
Reuben B.
Four Js
Posts: 1126


« Reply #1 on: September 26, 2011, 01:28:51 am »

I think you want ...

IMAGEEXPANDED="company"
IMAGECOLLAPSED="company"
IMAGELEAF="branch"

... and to use ...

ISNODECOLUMN to point to a column that is TRUE if the row is a company, FALSE if the row is a branch.  (as opposed to being set to TRUE if the row is a company with branches, FALSE if a branch or a company with no branches)

If you think of the case where you are building the tree dynamically, you won't know if the company has branches or not until you click to expand it.  For instance if you had the equivalent of Windows Explorer, you still want a directory/folder to show as a directory/folder even though there maybe no files in that directory, and you won't know that until the users clicks on the folder to look inside it.

Hope that helps,


Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #2 on: October 11, 2011, 11:16:00 am »

Reuben,
Apologies for the delay in getting back to you.

That's just what I needed - thanks.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines