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.
What Motivated the Team at Alpha Software to Create Alpha Anywhere for Developing and Deploying Mobile and Web Apps?
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 to Create an App for Free
How to Create an App for Free
Advanced Capabilities for Synchronizing Data in Alpha Anywhere Mobile Apps Designed for Offline Use
Advanced Capabilities for Synchronizing Data in Alpha Anywhere Mobile Apps Designed for Offline Use
Alpha Software Recognized for Leadership in Low-Code
Alpha Software Recognized for Leadership in Low-Code


Subscribe To Blog

Subscribe to Email Updates