Standards-based RMADOne of Alpha Anywhere's core strengths is its commitment to standards.
Climbing Trees with Alpha AnywherejsTree is a very powerful, open source, jQuery Tree control and works beautifully with Alpha Anywhere. The node hierarchy in jsTree is fed with JSON which is easily created by an Alpha callback to a sql back end. The nodes sql table is a very simple 4 column table (in this case) which includes a node Id, a node ParentId, a description, and, optionally, an icon for the node.
The nodes selected per record are held in another table with 2 columns: RecordId and NodeId… which, in this case, is a Category Id.
Animation of the tree can be turned on or off, when the tree is rendered it can be collapsed, partially opened, or fully opened. As nodes are selected, if a parent node is in place that parent node is shaded to show an effect on that parent.
I’ve place an event on this tree which, on change of a node, will set the UX dirty. So, as nodes are selected or de-selected, the UX Submit button becomes active. When the UX record is submitted, a jsTree method returns all the selected nodes in a comma delimited string which is then sent off to a callback, processed, and written to a table.
As you navigate from record to record in the UX, a callback is made to get the nodes for that specific record and a jsTree method is then called updating the tree with those nodes.
Full drag and drop is supported and I’ll be looking at a mobile aspect regarding this in another video.
jsTree… very powerful, chock full of methods, events and features, and plays very well with Alpha Anywhere.
This post if part 1 of a 2 part series on integrating custom controls with Alpha Anywhere. Click here to read part 2.