Denver Dave
Založený: 02.02.2003
Príspevky: 19
Zaslal: 2003-12-04 23:28
Návrat hore
Odpovedať s citátom
|
We have a table of various musical performers and a table that identifies music categories and one that shows performer / category combinations (link table).
When we add a new performer to an event for a certain music category, we currently know what performers perform in that music category, but have to choose from a drop down of all performers for all categories.
Instead of searching a drop down of 100's of performers it sure would be nice to only have the couple dozen that may actually be valid for the current category. Any ideas?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2003-12-05 01:14
Návrat hore
Odpovedať s citátom
|
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html#AEN682
the 'filters' option
but you have to know some information before printing the form to user
|
moi
Založený: 21.01.2005
Príspevky: 12
Zaslal: 2005-06-08 19:28
Návrat hore
Odpovedať s citátom
|
Could I use this to filter one drop down based on the selection of another drop down?
i.e.
Use
$opts['fdd']['col_name']['values']['filters'] = 'id IN DropDownA_Selected'; // optional WHERE clause
instead of
$opts['fdd']['col_name']['values']['filters'] = 'id IN (1,2,3)'; // optional WHERE clause
|
funny
Založený: 15.07.2005
Príspevky: 2
Zaslal: 2005-07-15 21:56
Návrat hore
Odpovedať s citátom
|
I finally managed to understand how to make a dropdown list that takes its values from another table.
Now I have another problem
When I select some option from the dropdown list is it possible for the next field to get its values from yet another table(s) depending on the selected option?
That is to say that:
$opts['fdd']['c3'] = array(
'name' => 'C3',
'select' => 'D',
'maxlen' => 50,
'sort' => true
);
$opts['fdd']['c3']['values']['table'] = 'c3_table';
$opts['fdd']['c3']['values']['column'] = 'value';
If it chooses the first option (red) I would like that the next field to get its values from a "red_table"
If it chooses the second option (yellow) I would like that the next field to get its values from a "yellow_table"
Like this
if SOME_CODE_HERE
{
$opts['fdd']['c4'] = array(
'name' => 'C3',
'select' => 'D',
'maxlen' => 50,
'sort' => true
);
$opts['fdd']['c4']['values']['table'] = '
red_table
';
$opts['fdd']['c4']['values']['column'] = 'value';
}
else
{
$opts['fdd']['c4'] = array(
'name' => 'C3',
'select' => 'D',
'maxlen' => 50,
'sort' => true
);
$opts['fdd']['c4']['values']['table'] = '
yellow_table
';
$opts['fdd']['c4']['values']['column'] = 'value';
}
Is it at all possible?
Thanks in advance for any ideas
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2005-07-18 16:24
Návrat hore
Odpovedať s citátom
|
easy approach is to have a preselect (on a different page) which will ask "yellow or red?" linking to the main page with ?color=red
on the main page
if($_GET['color']= red {...}
else {...}
however, this will break list/view page.
imho there is no easy way to have consistent list page when joining to two tables as in your case.
if you had date in a single table, with an extra column (red/yellow), you could use 'filters' option.
another question is to have a dhtml/js preselect. which is not doable without hacking main class.
|
tech_one
Založený: 06.08.2005
Príspevky: 2
Zaslal: 2005-08-06 17:16
Návrat hore
Odpovedať s citátom
|
Moi,
Did you find a solution for this? I need to do the same thing.
Mick
| moi Napísal: |
Could I use this to filter one drop down based on the selection of another drop down?
i.e.
Use
$opts['fdd']['col_name']['values']['filters'] = 'id IN DropDownA_Selected'; // optional WHERE clause
instead of
$opts['fdd']['col_name']['values']['filters'] = 'id IN (1,2,3)'; // optional WHERE clause |
|
choke
Založený: 15.08.2008
Príspevky: 1
Zaslal: 2008-08-15 20:35
Návrat hore
Odpovedať s citátom
|
Is this feature still pending?
It is very useful to update the options of a drop down box on the fly.
|
|
Odoslať novú tému
Odpovedať na tému
|