Drop Down List in Customized Column

Tips submitted by PHPMaker users
Post Reply
shahparz
User
Posts: 17
Location: http://shahparzsoft.net

Drop Down List in Customized Column

Post by shahparz »

If you have multiple options in a customized column then u can use these lines to make the junk links as drop down.

(The following are server events. Read "Server Events and Client Scripts" in the help file first.)

function ListOptions_Load() {
$opt =& $this->ListOptions->Add("new1");
$opt->Header = "Selections";
$opt->OnLeft = TRUE; // Link on left
$opt->MoveTo(1); // Move to first column
}

function ListOptions_Rendered() {
$v_student_id = CurrentTable()->student_id->CurrentValue;

$this->ListOptions->Items["new1"]->Body="<select class='menu_choice' name='non-cccr_stuff' onchange='window.location=this.value'>
<option value='#list'><b>Please Select .......</b></option>
<option value='bfd.php?student_id=$v_student_id'>Admission Form</option>
<option value='bfd.php?student_id=$v_student_id'>Authority Card</option>
<option value='bfd.php?student_id=$v_student_id'>Bonafide Certificate</option>
<option value='bfd.php?student_id=$v_student_id'>Character Certificate</option>
<option value='bfd.php?student_id=$v_student_id'>Participation Certificate</option>
<option value='bfd.php?student_id=$v_student_id'>School Leaving Certificate</option>
</select>";

Hope to helped u guys.


oliveira
User
Posts: 45

Post by oliveira »

Got it!
I modified this code
// "detail_copiar"
$oListOpt =& $this->ListOptions->Items["detail_copiar"];
if ($Security->AllowList('copiar')) {
$oListOpt->Body = $Language->Phrase("DetailLink") . $Language->TablePhrase("copiar", "TblCaption");
$oListOpt->Body = "<a href=\"cal2.php?" . "CARTEIRA=" . urlencode(strval($socios->CARTEIRA->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";

		to this
		// "detail_copiar2"
	$oListOpt =& $this->ListOptions->Items["detail_copiar2"];
	if ($Security->AllowList('copiar')) {
		    //$oListOpt->Body = $Language->Phrase("DetailLink") . $Language->TablePhrase("", "");
		$oListOpt->Body = ""  . "CARTEIRA=" . urlencode(strval($socios->CARTEIRA->CurrentValue)) ;

then

function ListOptions_Rendered() {
//$v_socios_id = $oListOpt->Body;
//$oListOpt =& $this->ListOptions->Items["copy"];
$oListOpt =& $this->ListOptions->Items["detail_copiar2"];
$oListOpt->Body = "" . $oListOpt->Body . "";

$this->ListOptions->Items["new1"]->Body="<select class='menu_choice' name='non-cccr_stuff' onchange='window.location=this.value'>
<option value='#list'><b>Selecione</b></option>
<option value='bfd.php?$oListOpt->Body'>Admission Form</option>

</select>";


oliveira
User
Posts: 45

Post by oliveira »

Its ok for a cancel button


Post Reply