About

Present items in a hierarchical tree structure with the wijtree widget. The wijtree widget control supports expand/collapse animations, stylish themes, and drag-and-drop functionality. You can initialize an undordered list (UL) element or an ordered list (OL) element to create the treeview.


General

Tip: Use our code snippets to easily create the object with all the childs.


Attribute

Binds value for attributes to the object. All valid attributes can be binded.


Format from Application Class:


marginLeft:10,shadow:true


Style

Binds value for styles to the object. All valid styles can be binded.


Format from Application Class:


width: 100px; length: 200px


Disable

If the binded value for this field contains a value, the object will not be rendered from the server to the client. The disable function will also disable all child objects.


AJAX ID

The Ajax ID used in OnAjax method in the application class.


Prevent reload at initialization

As a default all components with ajax call will trigger an reload event after document is loaded. Enable to prevent the init reload.


Trigger Ajax Call

All our components using ajax have the possibility to be manually triggered with a javascript function. The function name is: reload+component name. If you have a component named myChart, you can trigger the javascript function:


reloadmyChart();

 

Using Tree with Ajax

For the ajax implementation of the tree component, we use a own structure in SAP.


method get_tree_data.


data: it_tree type /neptune/wijmo_tree_tt,

      wa_tree like line of it_tree,

      lt_roles_all type table of agr_agrs,

      wa_roles_all like line of lt_roles_all.


* Top Node

  if ajax_value is initial.

     

     select *

            from agr_agrs

            into table lt_roles_all

            up to 1000 rows.

     

     delete adjacent duplicates from lt_roles_all comparing agr_name.


     loop at lt_roles_all into wa_roles_all.


       wa_tree-text = wa_roles_all-agr_name.

       wa_tree-url = '#'.

       wa_tree-haschildren = 'true'.

       append wa_tree to it_tree.


     endloop.


  else.


*    If stateful - no need for select again

     select *

            from agr_agrs

            into table lt_roles_all

            where agr_name eq ajax_value.


     loop at lt_roles_all into wa_roles_all.

       wa_tree-text = wa_roles_all-child_agr.

       wa_tree-url = '#'.

       append wa_tree to it_tree.

     endloop.


  endif.


* Send JSON to Client

  call method server->api_table_to_json

    exporting

      table_data = it_tree

      do_send    = 'X'.


endmethod.


External Reference

http://wijmo.com/wiki/index.php/Tree