Drop Down List in Customized Column

Tips submitted by PHPMaker users

Drop Down List in Customized Column

Postby shahparz » Mon Apr 01, 2013 2:44 am

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.
shahparz
 
Posts: 25
Joined: Sat Nov 24, 2012 7:43 pm

Re: Drop Down List in Customized Column

Postby oliveira » Wed Oct 08, 2014 5:20 am

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
 
Posts: 45
Joined: Mon Feb 25, 2013 8:29 pm

Re: Drop Down List in Customized Column

Postby oliveira » Fri Sep 16, 2016 5:53 am

Its ok for a cancel button
oliveira
 
Posts: 45
Joined: Mon Feb 25, 2013 8:29 pm


Return to User Submitted Tips (PHPMaker)