update dropdown list after produce
update dropdown list after produce
hi, how to update/add more list dropdown list after produce?
Re: update dropdown list after produce
You can do it one of a few ways:
The basic way:
(1) add the new dropdown list options to your Appgini project and regenerate your files. Then replace all of the old files with all of the new files
or
Replace the one individual file way:
(2) add the new dropdown list options to your Appgini project and regenerate your files. Then replace just the one file that is actually affected by the change: yourtablename_dml.php (of course you need to change yourtablename to the actual table name that has been edited).
or
Edit just the one existing file:
(3) If you do not want to regenerate your entire project again, you can open yourtablename_dml.php and find the lines that look something like this (this is using Appgini V5.50):
then edit the line:
to add your additional dropdown options:
You should of course replace yourtablename, yourfieldname and OPTION1, etc with your own table, field and option names.
That should work for you
The basic way:
(1) add the new dropdown list options to your Appgini project and regenerate your files. Then replace all of the old files with all of the new files
or
Replace the one individual file way:
(2) add the new dropdown list options to your Appgini project and regenerate your files. Then replace just the one file that is actually affected by the change: yourtablename_dml.php (of course you need to change yourtablename to the actual table name that has been edited).
or
Edit just the one existing file:
(3) If you do not want to regenerate your entire project again, you can open yourtablename_dml.php and find the lines that look something like this (this is using Appgini V5.50):
Code: Select all
// combobox: yourfieldname
$combo_yourfieldname = new Combo;
$combo_yourfieldname->ListType = 0;
$combo_yourfieldname->MultipleSeparator = ', ';
$combo_yourfieldname->ListBoxHeight = 10;
$combo_yourfieldname->RadiosPerLine = 1;
if(is_file(dirname(__FILE__).'/hooks/yourtablename.yourfieldname.csv')){
$yourfieldname_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/yourtablename.yourfieldname.csv')));
$combo_yourfieldname->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($yourfieldname_data)));
$combo_yourfieldname->ListData = $combo_contype->ListItem;
}else{
$combo_yourfieldname->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("OPTION1;;OPTION2;;OPTION3;;OPTION4")));
$combo_yourfieldname->ListData = $combo_yourfieldname->ListItem;
}
$combo_yourfieldname->SelectName = 'yourfieldname';
Code: Select all
$combo_yourfieldname->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("OPTION1;;OPTION2;;OPTION3;;OPTION4")));
Code: Select all
$combo_yourfieldname->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("OPTION1;;OPTION2;;OPTION3;;OPTION4;;OPTION5;;OPTION6")));
That should work for you