Hi everyone
Been tweaking my AppGini app quite a loot .. but one thing is still bugging me: I cannot figure out, how to pre-select an item within a dropdown .. that's usually empty, when creating new records.
I need a hint on where to modify the code, for setting temporary defaults, for a specific dropdown - that normally has an empty default.
Anyone?
Pre-selecting an existing item
Re: Pre-selecting an existing item
Hi,
you can try this:
add to the hooks/tablename.php -> tablename_dv function the following:
replace lookup with the fieldname that have for your lookup field and the 1 with the ID of your pre-selected item.
you can try this:
add to the hooks/tablename.php -> tablename_dv function the following:
Code: Select all
if (!$selectedID) {
$html.=<<<EOC
<script>\$j(function() {if (AppGini.current_lookup.value=="") AppGini.current_lookup.value=1});</script>
EOC;
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Pre-selecting an existing item
Thanks .. worked as a charm.