Display a text just above the data table header

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 429

Display a text just above the data table header

Post by Bishu »

I am trying to display a small text just above the data table header.
It is showing fine by the following code written in the Server Events->Table Specific->Common->Row_Rendering

function Row_Rendering() {
// Enter your code here
if(EW_PAGE_ID == "list" && CurrentPage()->RowCnt == 0){
$id = $this->ac->AdvancedSearch->SearchValue;
$name = ew_ExecuteScalar("SELECT acname from ACCOUNT WHERE acno='".$id."'");
$start = $this->rdate->AdvancedSearch->SearchValue;
$end = $this->rdate->AdvancedSearch->SearchValue2;
$dataheader = "<h4 align='center'>Account Statement of $name, CashSMS ID $id from $start to $end.</h4>";
echo $dataheader;
}
}

the text is showing exactly where I want to show it.
But it also display inside the search box.

Kindly help me not to display inside the search box.


mobhar
User
Posts: 11748

Post by mobhar »

Bishu wrote:
the text is showing exactly where I want to show it.
But it also display inside the search box.

What do you mean with "But it also display inside the search box". Did you mean the text is shown twice?


Bishu
User
Posts: 429

Post by Bishu »

@mobhar

yes the text is showing twice one in the search box and the another above the data header.

I want to show it only above the data header.


mobhar
User
Posts: 11748

Post by mobhar »

Then simply use "Page_DataRendering" server event that belongs to the List page instead.

"Server Events" -> "Table-Specific" -> "List Page" -> "Page_DataRendering".

function Page_DataRendering(&$header) {
$id = $this->ac->AdvancedSearch->SearchValue;
$name = ew_ExecuteScalar("SELECT acname from ACCOUNT WHERE acno='".$id."'");
$start = $this->rdate->AdvancedSearch->SearchValue;
$end = $this->rdate->AdvancedSearch->SearchValue2;
$header = "<h4 align='center'>Account Statement of $name, CashSMS ID $id from $start to $end.</h4>";
}


Bishu
User
Posts: 429

Post by Bishu »

thanks for your help

I have already tried in the page_DataRendering
It is showing outside the data table.

I would like to use in the Row_Rendering but should not be display in the search box.


mobhar
User
Posts: 11748

Post by mobhar »

Please note that Row_Rendering event will be called before rendering (applying the View/Edit Tag settings) a record. That's why it also is affected to the field in the search box.


Post Reply