Guide 15 - Plugin Selection Tree Type |
5/21/2021 7:02:47 PM |
PHPRunner Tips and Tricks | |
![]() How difficult it is to select and use a selection of tree or dependence information between the data! And that there are many information that adjust to this tree-like structure. The plugin that has been available for a long time and is available on this portal is very good, but aesthetically it is very outdated with respect to the Bootstrap designs that we now use in our projects. I have found some JavaScript plugins, but none (it is my impression) to be able to integrate them into the PHPrunner plugins. Objective Use the JavaScript SearchAreaControl plugin in a Phprunner project. |
|
![]() |
fhumanes author 5/21/2021 |
Solution Demo: https://fhumanes.com/tree. In one of its configurations the plugin has this image
In the example what I have done is to have 2 tables:
The example looks like this
As we can appreciate there is 3 ways to see/update information regarding documents:
I wanted to make it very simple for easy to understand the steps that must be done to use this plugin or another of the same type. The example is done in phprunner 10.2, so that it is easy for you to open and so you can see that this system is worth for any version 10.x of phprunner. In the tree directory I have left the CSS and JS file, which requires this plugin. In the MyCode directory I left the hierrarchy.php file That does 2 things, mainly:
I have also created 2 Snippet file: tree_single - for the solution of a lookup of a single value. Additionally, I have created code for the JavaScript event onload event that controls when we press the SAVE button and control if we have selected at least one value and copy the plugin selection value to the table field. As you can see, I have commented on the code to establish the language of the plugin and this is because when I use it, it gives me error the method getSelectedByAttribute. How the plugin, by default responds in English 'en' what I do is put the label 'en' on the constants I want you to answer. For the snippet to know what is the recipient field of the plugin value and to pass parameters to the snippet I used the Before Display events. I leave you on my portal, the files to download the project and database and you can try it on your PCs. For any questions or comment, please indicate it through my email fernandohumanes@gmail.com |