Climbing Trees with Alpha Anywhere: Integrating a Custom JavaScript Tree Control

Blog



Climbing Trees with Alpha Anywhere: Integrating a Custom JavaScript Tree Control


This post was written by independent Alpha Anywhere developer David Kates. It is part 2 in a series on integrating custom controls with Alpha Anywhere. Click here to read part 1. 



Trees & Grids & Alpha… oh my!

The folks at DHX had created a JavaScript Tree control and a JavaScript Grid control and then they decided to mash the two together in the form of a control they named TreeGrid. TreeGrid can take data in XML and JSON (actually 2 different formats of JSON). Since it’s a very JSON world that’s what we’re dealing with here.

The folks at Alpha let us implement JavaScript controls easily and give us incredible abilities in Xbasic in order to feed those controls with data. In the case of the TreeGrid we need hierarchical data and grid data (if wanted) per node of the tree.


Overview video

Now...I’m not going to say this was easiest integration I’ve ever done...but the end result is well worth the head-scratching. I sat and looked at my screen patiently waiting for my brain to wrap around the concept of unlimited number of hierarchical nodes plus data for each node...or no data. Part of the challenge was that the TreeGrid likes it’s JSON a bit non-standard, which is ok, but it makes you work a bit harder for a great end result.

By the end of the journey and a reminder from Selwyn about some really interesting functions in Xbasic I had used no less than 10 of those functions including a5_treeTextToJSON, dump_properties, *tree_from_dependencies, *tree_to_outline, *variable_to_script, json_parse, evaluate_template, and vartojson. These functions are little bits of magic without which life would not be as much fun as it is. They, and many others like them, are indispensable for taking data from a sql source and turning and twisting that data to fit your needs.

The end result is a data tree with unlimited nodes and data per node. The data in each column can take the form of Editable data, Read-only, Text, TextArea, Radio Button, Checkbox, Dropdown, Price format, and Dynamic… which is like conditional formatting for the column.

Alpha Anywhere can easily talk to the world around it. That’s what makes it an amazing environment to work in.



About David Kates

David Kates is the owner of Adjustable Software, a consulting and development firm who specialize in Microsoft Access to Alpha Anywhere conversions, API integration, PayPal integration, jQuery & JavaScript plug-in integration, NFC tag scanning, and more.

RMAD tools jQuery, HTML5, JavaScript
Adventures in Alpha Land now in the iTunes store
The Quickest way for Companies to Mobilize - A Powerful App Development Platform and a System Where IT and Business Units Work Together as Team!

About Author

Default Author Image
Chris Conroy

Chris Conroy runs digital programs for Alpha Software.

Related Posts
How Enterprise Architects Can Drive Digital Transformation
How Enterprise Architects Can Drive Digital Transformation
Updating Mobile Apps Just Got WAY Easier
Updating Mobile Apps Just Got WAY Easier
Cold Season Is Here: Here's Some Alka Seltzer for Your Mobile App Development Pains
Cold Season Is Here: Here's Some Alka Seltzer for Your Mobile App Development Pains

Comment

Subscribe To Blog

Subscribe to Email Updates