I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » Tips and Trick » A Case Study: Highlighting Master Record Based on the Last Master/Detail Visited Page in Websites that Generated by PHPMaker 9.2.0
A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
How to Limit Record Count Displayed in List Page of Websites that Generated by PHPMaker 9.2.0

April 30, 2013

A Case Study: Highlighting Master Record Based on the Last Master/Detail Visited Page in Websites that Generated by PHPMaker 9.2.0

Sometimes, users who have just visited the Master/Detail page of the certain record and back to its Master page, want to know which record in that Master page that he had just visited its detail page quickly. For example, by highlighting that related record in the Master page. This is very important for them so that they won't visit the same detail page again.

Now I will show you step by step how to implement this case study. We will use both Server Events and Client Scripts. This trick is very useful if your users are browsing the records one by one by viewing its detail page, and after they come back to its master page, then they are able to identify quickly which record they had just visited.

In this following example, let's use the PHPMaker demo project which you can download it from the official website of PHPMaker. For simplicity, we will use orders as the Master table, and orderdetails as the Detail table. For further information, please visit the related topic in PHPMaker discussion forum.

[hidepost]

  1. Run the PHPMaker demo project (.pmp) file using your PHPMaker application.
  2. From the Database pane in the left side, please choose/click on orderdetails table, then you will see there are three new tabs appear in the top right pane. Click on Code (Server Events, Client Scripts and Custom Templates) tab, expand the following path: Client Scripts -> Table-Specific -> List Page -> Startup Script, and then insert the following code into the code editor at the right pane:

    $(document).ready(function(){
       $("a[href='orderslist.php']").attr('href', 'orderslist.php?OrderID=<?php echo isset($_GET&#91;"OrderID"&#93;)?ew_StripSlashes($_GET&#91;"OrderID"&#93;):"" ?>');
    });
    

    This code means add the suffix in the Back to master table link with the OrderID as the master key in the current master/detail page.

  3. Next step, from the Database pane in the left-side of your PHPMaker, click on orders table, and then expand the following path: Server Events -> Table-Specific -> Common -> Row_Rendered, and then insert the following code into the function:

        if (isset($_GET["OrderID"])) {
           $getMasterKey = ew_StripSlashes($_GET["OrderID"]);
           if ($this->OrderID->CurrentValue==$getMasterKey) {
              $this->RowAttrs["style"] = "background-color: #FF6600";       
           }
        }
    

    This code means to highlight the row in Master page if its key is equal with the last master/detail key that has just visited.

  4. Finally, re-generate your script files using PHPMaker as always. Have a nice code!

[/hidepost]

Article by Masino Sinaga / Tips and Trick / Client Scripts, jQuery, PHPMaker 9.2.0, Row_Rendered, Server Events Leave a Comment

A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
How to Limit Record Count Displayed in List Page of Websites that Generated by PHPMaker 9.2.0

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2021 Project File Is Released
  • PHPMaker 2021 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2021 Is Released!
  • A New PHPMaker 2020 Project File Is Released
  • PHPMaker 2020 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2020 Is Released!
  • Inventory Stock Management Project, Why Should You Have It?
  • A New PHPMaker 2019 Project File Is Released!
  • PHPMaker 2019 Demo Project File Is Released!
  • Masino Extensions for PHPMaker 2019 Is Released!

Search

Recent Comments

  • saleh alayafi on A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
  • Masino Sinaga on A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
  • saleh alayafi on A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
  • Masino Sinaga on A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0
  • Masino Sinaga on A Case Study: Hiding Certain Fields Based on the Selected Value in ComboBox in Add Pages of the Websites that Generated by PHPMaker 9.2.0

Demo Website

  • Demo of I Love PHPMaker 2021 (MasinoExtensions).
  • Indonesia Post Offices.
  • Stock Inventory Management.
  • Demo of PHPMaker + PHP Report Maker

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (3)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (79)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2021
  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2019 by Masino Sinaga | WordPress | Log in | Back to top