This PHPMaker 2024 project will show you how to update only the small part of section in List and View pages based on the Click event, without having to reload the entire page.
There are two ways we can achieve it so easily:
- Via Custom File
- Via Api_Action server event
For the First Way (Table 1), then we need to write additional code in a Custom File in order to update the value in Database. After clicking the value on Is Active column, the value in Database updated, and it changes immmediately on User-Interface (UI).
For the Second Way (Table 2), we may create our own API in Api_Action in order to update the value in Database. After clicking the value on Status column, the value in Database updated, and it changes immmediately on UI.
By using this project, then you may learn the following things:
- How to Quick Update the value in Database, and then display the result immediately on UI without having to reload the entire page.
- How to write PHP code in a Custom File that will be called from another page in order to update the value in Database.
- How to write PHP code in Api_Action server event that will be called from another page in order to update the value in Database.
- How to pass two params (ID and Value, so that based on those params, we can change the certain Value in Database); either via Custom File or Api_Action server event.
- How to use Row_Rendered server event in order to manipulate the element at each row in List Page, and display the change with that helper.
- How to distinguish the client event handling from List Page and View Page, since the route pattern is different between those 2 pages.
- How to compare which way that best suits your needs between using Custom File and Api_Action.