Guide 33 – Context menu. data selection |
1/17/2022 7:42:04 PM |
PHPRunner Tips and Tricks | |
![]()
As we will see, with PHPRunner it is solved quite simply. What is necessary is to know some characteristics of the product that its use is not habitual. In this example that I am going to use to explain the solution, what is desired is, from the data of a school, select a class and on this class, a contextual menu appears that allows us to manage the data of said class. It will give the sensation of a dynamic menu, but it is not so much. We will see how easy it is to solve this requirement. Objetive From the set of all the data (school) we are going to select a set (class) and on the data of the selected class, we update its information. DEMO: https://fhumanes.com/menu If you are interested in this tea, continue reading the article at this link . |
|
![]() |
fhumanes author 1/17/2022 |
I am going to explain functionally what I have done, so that the solution is understood.
(1) Button to set the class with which we want to work. (3) the record with which we want to do the action is selected. (2) button to clear the selection that has previously been made.
(2) all the information that is provided is subject to the selection of the previously fixed context.
The “Fix College” button has this code: $result["txt"] = "No college has been selected"; Mainly what it does, if all goes well, is create 3 session variables with the college data. These variables will be used for the selection of information and adaptation of the menu. In the menu event “Menu item:Modify”, I have coded: $title = $menuItem->getTitle();
All options beginning with "m1" are treated to display if “college” has previously been selected or are “removed” if not already done. The selection of the data of the selected "college" is done through the "After table initialized" event: $query->addWhere("menu_college_id=".$_SESSION["id"]); PHPRunner has a lot of facilities to adapt the interface and the data and it makes things like this very, very easy to program. For any questions or what you need, contact me through my email fernandohumanes@gmal.com |