If you are using the PreviewRow extension in order to display the detail preview row of the certain master record, you will find that if no detail records found for that master record, then the tab view will look so ugly, since there is no the outline border around of its area. You will only see the "(No records found)" text followed by the link to display the table detail page. This following customization will add an empty table above the text "(No records found)", so it will add the outline border around its tab. Now you will see the view of Tab become better than before.
Besides that, the following customization will also make the table width of detail become using a hundred percent approach; both for the condition when records are found and when no records found. This is very useful if you don't want to see an empty area in the right side of detail tabel. We want to optimize the width of the detail table to the master table width, so the detail preview will look better and more beauty than before. Only a small customization, yet so powerful.
Updated on September 5, 2012: This customization has been implemented in PHPMaker version 9.0.4, it matches to each other, and as a result, it works properly.
Updated on November 29, 2012: This customization has been implemented in PHPMaker version 9.1.0, it matches to each other, and as a result, it works properly.
Updated on February 10, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.
Updated on June 17, 2013: The customization has been handled by using MasinoPreviewRow extension. You don’t need to implement the customization below if you use my extensions together with the original PHPMaker Template and Extension files.
[hidepost]
-
Open your \Script\ewcfg.php file, and find this code:
// General
before that line, please insert the following code:
// Begin of modification Empty Table in Detail Preview List Pages, by Masino Sinaga, November 29, 2012 define("MS_SHOW_EMPTY_TABLE_IN_DETAIL_PREVIEW", TRUE, TRUE); define("MS_TABLE_WIDTH_IN_PREVIEW_ROW_100_PERCENT", TRUE, TRUE); // End of modification Empty Table Detail Preview List Pages, by Masino Sinaga, November 29, 2012 -
Open your \extensions\PreviewRow\preview-script.php file, and find this code:
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
then replace it with the following code:
<?php // Begin of modification Empty Table in Detail Preview List Pages, by Masino Sinaga, November 29, 2012 ?> <?php if (MS_TABLE_WIDTH_IN_PREVIEW_ROW_100_PERCENT==TRUE) { ?> <table cellspacing="0" class="ewGrid" width="100%"><tr><td class="ewGridContent"> <?php } else { ?> <table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent"> <?php } ?> <?php // End of modification Empty Table in Detail Preview List Pages, by Masino Sinaga, November 29, 2012 ?> -
Still in that \extensions\PreviewRow\preview-script.php file, find again this code:
<div>(<!--##@NoRecord##-->)</div>
then replace it with the following code:
<?php // Begin of modification Empty Table in Detail Preview List Pages, by Masino Sinaga, November 29, 2012 ?> <?php if (MS_SHOW_EMPTY_TABLE_IN_DETAIL_PREVIEW) { ?> <?php if (MS_TABLE_WIDTH_IN_PREVIEW_ROW_100_PERCENT) { ?> <table cellspacing="0" class="ewGrid" width="100%"><tr><td class="ewGridContent"> <?php } else { ?> <table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent"> <?php } ?> <div class="ewGridMiddlePanel"> <table id="ewDetailsPreviewTable" name="ewDetailsPreviewTable" cellspacing="0"<!--##=ewCSSTableClass##-->> <thead><!-- Table header --> <tr<!--##=ewCSSTableHeaderClass##-->> <?php if (MS_SHOW_RECORD_NUMBER_COLUMN_ON_DETAIL_PREVIEW) { ?> <td style="text-align: center;"><?php echo $Language->Phrase("RecNo"); ?></td> <?php } ?> <!--## for (var i = 0; i < nFldCount; i++) { if (GetFldObj(arFlds[i])) { ##--> <?php if ($<!--##=gsFldObj##-->->Visible) { // <!--##=gsFldName##--> ?> <td<!--##=FieldTD_Header(FIELD)##-->><table class="ewTableHeaderBtn"><tr><td><?php echo $<!--##=gsFldObj##-->->FldCaption() ?></td></tr></table></td> <?php } ?> <!--## } } // Field ##--> </tr> </thead> <tbody> <tr<?php echo $<!--##=gsTblVar##-->->RowAttributes() ?>> <td style="text-align: center;"> </td> <!--## for (var i = 0; i < nFldCount; i++) { if (GetFldObj(arFlds[i])) { ##--> <?php if ($<!--##=gsFldObj##-->->Visible) { // <!--##=FIELD.FldName##--> ?> <!-- <!--##=FIELD.FldName##--> --> <td<!--##=FieldTD_Item(FIELD)##--><?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><!--##=SYSTEMFUNCTIONS.FieldView()##--></td> <?php } ?> <!--## } } ##--> </tr> </tbody> </table> </div> </td></tr></table> <?php } ?> <?php // End of modification Empty Table in Detail Preview List Pages, by Masino Sinaga, November 29, 2012 ?> <div>(<!--##@NoRecord##-->)</div> - Finally, re-generate your script files using PHPMaker as always.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.