NetTalk Central

Author Topic: Tree function  (Read 4331 times)

bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Tree function
« on: October 24, 2007, 02:40:47 AM »
Hi,

I have two questions;

1. How to implement a Tree function on a browse (with levels)

2. In a Browse the rows are highlighted after a click. It is possible to have it highlighted on a MouseOver?

Thanks

Bram Kip

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Tree function
« Reply #1 on: October 24, 2007, 03:07:56 AM »
Hi Bram,

1) There are a number of javascript tree controls floating around on the web, but I've not had an opportunity yet to incorporate one of them into the NetTlak package. It's on my list though.

2) I've played with this on and off, it's also been on my list, but I've not made a solution yet that I like, that works the way I want it to. It's also still on my list though.

Cheers
Bruce

Evert

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Tree function
« Reply #2 on: December 24, 2007, 12:59:08 PM »
I used this one in my "MenuOnLeft":

http://www.softcomplex.com/products/tigra_tree_menu/docs/

It's flexible, easy to use, and free...  :)

I can recommend it.
regards
Evert


bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Re: Tree function
« Reply #3 on: December 30, 2007, 11:22:31 AM »
Hi Evert,

Indeed this is nice, but I need a Tree function for a parent with child browses. I think this is not possible with this Tigra Tree menu.

regards,
Bram

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: Tree function
« Reply #4 on: December 30, 2007, 03:57:12 PM »
Hi Bram,
I think it is.
I used it in a different environment, to illustrate the dependecies between parent and child records in an AS/400 database.
It is just a matter of reading through the data the right way.
Trees are all about parents and children.
Rene
Rene Simons
NT14.14

Evert

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Tree function
« Reply #5 on: December 31, 2007, 12:44:45 AM »
Hallo Bram,
Even een stukje in het Nederlands.
Ik zag dat je uit Musselkanaal komt en dat is maar 100 kilometer hier vandaan (Dokkum)
Maar de rest doe ik in het Engels dan snappen de andere forum gebruikers het ook.  :)

Sorry guys this was just a little dutch.

however,
This is a sample of how i build the treeitems with three levels (And  more is just as simple)
I know it ia a long one, but it could be helpfull for someone
regards
Evert

!!!!!!!!! I use the Main lvel to retrun to the mainMenu
Treemenu  routine
  temptext='BACK TO MAIN MENU'
  linktext=clip('MenuOnLeft target="left_fram""')
  packet = clip(packet) & |
    '<9><<script language="JavaScript"><13,10>'&|
    '<9><<!--//<13,10>'&|
    '<13,10>'&|
    'var TREE_ITEMS = [<13,10>'&|
     '<9>['&''''&clip(temptext)&''''&','&''''&linktext&''''&',<13,10>'
      do SendPacket
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
!!!!! Then I make a menu-node that is only visible for customers to go to the check-out
  if p_web.GetSessionValue('Customernumber')>0
      temptext=clip('To ShoppingCart')
      linktext=clip('ToCheckout target="right_fram""')
      packet = clip(packet) & |
      '<9,9>['''&clip(temptext)&''''&','&''''&linktext&''''&'],<13,10>'
      do sendpacket
  .
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!Then the real Parent child thingy based on data files is starting

!!!!Based on these files:
  open(ProductMainGroup,42h)
  open(ConnectFileMainSub,42h)
  open(ProductSubgroup,42h)
  open(ConnectFileSubgroup_Group,42h)
  open(ProductGroup,42h)
!!!!!!!!!


!!!!Here we go!
  MAIN:MaingroupDescription=''
  set(MAIN:KeyMaingroupDescription,MAIN:KeyMaingroupDescription)
  loop until eof(ProductMainGroup)
  next(ProductMainGroup)

     temptext=clip(MAIN:MaingroupDescription)
   z#=0
   loop until z#=1
    if instring('''',temptext,1,1)>0
       x#=len(clip(temptext))
       temptext=clip( SUB( clip(temptext),1,(instring('''',temptext,1,1)-1))   &  SUB(clip(temptext),(instring('''',temptext,1,1)+1),x#) )
    else
       z#=1
    .
   end
  linktext=clip('Bestelregel<!-- Net:s:SID-->&BrowseOrderregels_Sort=+bes:DEBNUM,+bes:Artikelnr&amp;UpdateFile=Bestelregels&amp;UpdateKey=bes:KEYORDERREGE&amp;IDField=bes__ORDERREGELNU&amp;Insert_btn=Insert&amp;target=right_fram&amp;filtertext=Hgroup:'&MAIN:Maingroupnumber&'.')
  packet = clip(packet) & |
     '<9,9>['&''''&clip(temptext)&''''&','&''''&linktext&''''&',<13,10>'
                do sendpacket

    HS:Maingroupnumber=MAIN:Maingroupnumber
    set(HS:KeyMaingroupnumber,HS:KeyMaingroupnumber)
    loop until eof(ConnectFileMainSub) or HS:Maingroupnumber<>MAIN:Maingroupnumber
      next(ConnectFileMainSub)
      if HS:Maingroupnumber=MAIN:Maingroupnumber
         SUB:Subgroupnumber=HS:Subgroupnumber
         get(ProductSubgroup,SUB:KeySubgroupnumber)

                   temptext=clip(SUB:SubgroupDescription)
                   z#=0
                   loop until z#=1
                    if instring('''',temptext,1,1)>0
                       x#=len(clip(temptext))
                       temptext=clip( SUB( clip(temptext),1,(instring('''',temptext,1,1)-1))   &  SUB(clip(temptext),(instring('''',temptext,1,1)+1),x#) )
                    else
                       z#=1
                    .
                   end
                linktext=clip('Bestelregel<!-- Net:s:SID-->&BrowseOrderregels_Sort=+bes:DEBNUM,+bes:Artikelnr&amp;UpdateFile=Bestelregels&amp;UpdateKey=bes:KEYORDERREGE&amp;IDField=bes__ORDERREGELNU&amp;Insert_btn=Insert&amp;target=right_fram&amp;filtertext=Sgroup:'&SUB:Subgroupnumber&'.')
                packet = clip(packet) & |
                 '<9,9,9>['&''''&clip(temptext)&''''&','&''''&linktext&''''&',<13,10>'
                do sendpacket

                AKSG:Subgroup=SUB:Subgroupnumber
                set(AKSG:PerSubgroup,AKSG:PerSubgroup)
                loop until eof(ConnectFileSubgroup_Group) or AKSG:Subgroup<>SUB:Subgroupnumber
                 next(ConnectFileSubgroup_Group)
                 if AKSG:Subgroup=SUB:Subgroupnumber
                  ARG2:Groupnumber=AKSG:Groupnumber
                  get(ProductGroup,ARG2:KeyGroupnumber)

                       temptext=clip(ARG2:Description)
                       z#=0
                       loop until z#=1
                        if instring('''',temptext,1,1)>0
                           x#=len(clip(temptext))
                           temptext=clip( SUB( clip(temptext),1,(instring('''',temptext,1,1)-1))   &  SUB(clip(temptext),(instring('''',temptext,1,1)+1),x#) )
                        else
                           z#=1
                        .
                       end
                        linktext=clip('Bestelregel<!-- Net:s:SID-->&BrowseOrderregels_Sort=+bes:DEBNUM,+bes:Artikelnr&amp;UpdateFile=Bestelregels&amp;UpdateKey=bes:KEYORDERREGE&amp;IDField=bes__ORDERREGELNU&amp;Insert_btn=Insert&amp;target=right_fram&amp;filtertext=Agroup:'&ARG2:Groupnumber&'.')
                        packet = clip(packet) & |
                        '<9,9,9,9>['''&clip(temptext)&''''&','&''''&linktext&''''&'],<13,10>'
                          do SendPacket
                 .
                end



                packet = clip(packet) & |
                '<9,9,9>],<13,10>'
                  do SendPacket


      .
    end

    packet = clip(packet) & |
    '<9,9>],<13,10>'
      do SendPacket
  end
 
  packet = clip(packet) & |
    '<9>]<13,10>'&|
    '];<13,10>'&|
    '<9>//--><13,10>'&|
    '<9><</script><13,10>'&|
    ''
      do SendPacket

bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Re: Tree function
« Reply #6 on: January 02, 2008, 01:03:40 PM »
Hallo Evert,

<---- dutch ----->

Inderdaad, Dokkum is niet zover hier vandaan. Wat is je website?

<---- english ----->

Thanks for your example. I will try to implement this in my app.

Regards,

Bram