How to Edit a Record that belongs to a generated table from a Custom File (v2022)

Tips submitted by PHPMaker users
Post Reply
mobhar
User
Posts: 11660

How to Edit a Record that belongs to a generated table from a Custom File (v2022)

Post by mobhar »

For v2021, you may see How to Edit a Record that belongs to a generated table from a Custom File (v2021).

For v2022, we are still keep using the same example as well as for v2021 above. You may simply change the code in news.php Custom File of demo2022 project file as follows:

<div class="card">
	<div class="card-header">
		<h5 class="m-0">Latest News</h5>
	</div>
	<div class="card-body">
		<h6 class="card-title">2021/8/16 - PHPMaker 2022 Released</h6>
		<p class="card-text">For more information, please visit PHPMaker website.</p>
		<a href="https://phpmaker.dev" class="btn btn-primary">Go to PHPMaker website</a>
	</div>
</div>

<?php if (IsAdmin()) { ?>
<a href='#' class='btn btn-primary ew-row-link ew-edit' data-caption='Edit' data-url="ordersedit/11076" data-ew-action="modal">Edit Order 11076</a><br><br>
<?php } ?>

As you can see, in PHPMaker v2022, the code is much simpler than v2021.

  • No more table variables displayed very long/detail in Javascript code if you go to View Page Source of your browser.
  • No more calling Javascript global function ew.modalDialogShow.

Not only that, when we tried to display the Modal dialog that contains the Edit page for OrderID 11076 above after we have logged out from another tab, then no more page that contains messed page inside. It is now redirected back to the Login page automatically.

That is another main reason, why you should always use the latest major version.


Post Reply