This following trick will show you how we can hide a Tab based on the certain criteria on the Edit page of web applications that generated by PHPMaker 10. We will write a litte of jQuery code in the Client Scripts section of PHPMaker. In other words, we will not customize the template nor the generated code.
This is very useful if you want hide the certain tab dynamically or on-the-fly, based on the certain criteria. In this example, let's say we will hide a tab named tab_settings2 if the value of First_Setting field is blank.
Again, this trick will prove you how powerful PHPMaker which allows you inserting your own business-logic into your web application that generated by it without having to customize its template or the generated code.
[hidepost]
Simply put the following code under Client Scripts -> Table-Specific -> Edit Page -> Startup Script:
$(document).ready(function(){
if ($("#x_First_Setting").val().length == 0) {
$("[href='#tab_settings2']").hide();
}
});
[/hidepost]
Leave a Reply
You must be logged in to post a comment.