Home » RADICORE development » Framework » DropDown Field values - changing in runtime
Re: DropDown Field values - changing in runtime [message #7695 is a reply to message #7694] |
Wed, 09 March 2022 05:09 |
htManager
Messages: 431 Registered: May 2014
|
Senior Member |
|
|
Sorry for my English and how I try to explain what I mean.
The field gr_art_dropdown ('Größe (Art) auswählen')is a field with a dropdown list. It will be filled with the description of the size categories (shoes, cloths, etc.).
The field gr_art_ausr ('Größe') is the field where you can choose the right size of the chosen category.
The field ma_ausruestung_preis_eigenanteil ('Eigenanteil') is the field which holds the part of the total cost which will be payed by the team member.
I added two screen shots: the initial and a changed one. Hopefully you can see what I tried to explain. I added the code of the _cm_getValRep() method of the table from where the values come.
In the screenshot you see in 'Größe (Art) auswählen' the category of the size (shoes, cloth, etc.). And in 'Größe' the selectable values. In 'Eigenanteil' you see the value of the money (50.00, 5000,00).
In the green circle you can see the individual values of the compound foreign key which identify the key for filling the field 'Größe' with the right values.
// ************************************************************ ****************
function _cm_getValRep ($item=null, $where=null, $orderby=null)
// get Value/Representation list as an associative array.
{
$array = array();
switch ($item) {
case 'groessen_art_ausr_kopf' :
// get data from the database
$this->sql_select = 'gr_art, gr_art_sub, rdcaccount_id, ausruestungs_groesse_art_desc';
$this->sql_orderby = 'ausruestungs_groesse_art_desc';
$this->sql_ordery_seq = 'asc';
$data = $this->getData($where);
// convert each row into 'id=desc' in the output array
foreach ($data as $row => $rowdata) {
$key = '&' . $rowdata['gr_art'] . '&' . $rowdata['gr_art_sub'] . '&' . $rowdata['rdcaccount_id'];
$array[$key] = $rowdata['ausruestungs_groesse_art_desc'];
} // foreach
return $array;
case 'groessen_art_ausr_detail' :
// ermittelt den Primärschlüssel
if (isset($GLOBALS['gr_key_array'])) {
$primary_key_values = $GLOBALS['gr_key_array'];
} else {
$primary_key_values['1'] = $GLOBALS['fieldarray']['gr_art'];
$primary_key_values['2'] = $GLOBALS['fieldarray']['gr_art_sub'];
$primary_key_values['3'] = $GLOBALS['fieldarray']['gr_art_rdc'];
}
// get data from the database
$this->sql_select = 'orga_groessen_ausr_detail.gr_art_ausr, orga_groessen_ausr_detail.argroesse_desc';
$this->sql_from = "orga_groessen_ausr " .
" LEFT JOIN orga_groessen_ausr_detail ON (" .
"orga_groessen_ausr_detail.gr_art = orga_groessen_ausr.gr_art AND " .
"orga_groessen_ausr_detail.gr_art_sub = orga_groessen_ausr.gr_art_sub AND " .
"orga_groessen_ausr_detail.rdcaccount_id = orga_groessen_ausr.rdcaccount_id)";
$this->sql_orderby = 'argroesse_desc';
$this->sql_ordery_seq = 'asc';
$where = "gr_art = '{$primary_key_values['1']}' AND " .
"orga_groessen_ausr_detail.gr_art_sub = '{$primary_key_values['2']}' AND " .
"orga_groessen_ausr_detail.rdcaccount_id = '{$primary_key_values['3']}'";
$data = $this->getData($where);
// convert each row into 'id=desc' in the output array
foreach ($data as $row => $rowdata) {
$rowvalues = array_values($rowdata);
$array[$rowvalues[0]] = $rowvalues[0] . ' - ' . $rowvalues[1];
} // foreach
return $array;
} // switch
return $array;
} // _cm_getValRep
[Updated on: Wed, 09 March 2022 09:03] Report message to a moderator
|
|
|
|
|
DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Sat, 12 February 2022 04:22
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Tue, 15 February 2022 07:09
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Thu, 17 February 2022 04:28
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Sat, 19 February 2022 04:56
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Sun, 06 March 2022 04:57
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Wed, 09 March 2022 04:36
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Fri, 11 March 2022 06:03
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Mon, 14 March 2022 05:41
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Wed, 16 March 2022 05:48
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Thu, 24 March 2022 06:54
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Fri, 25 March 2022 06:48
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Sat, 26 March 2022 06:18
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Fri, 01 April 2022 09:59
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Sun, 10 April 2022 03:17
|
|
|
Re: DropDown Field values - changing in runtime
|
|
|
Re: DropDown Field values - changing in runtime
By: AJM on Wed, 13 April 2022 04:47
|
|
|
Re: DropDown Field values - changing in runtime
|
Goto Forum:
Current Time: Thu Oct 31 20:31:25 EDT 2024
Total time taken to generate the page: 0.01697 seconds
|