| Index
» Projekty
» phpMyEdit
» Fórum
» Custom button again |
 |
tszabo
Založený: 07.11.2006
Príspevky: 4
Zaslal: 2006-11-07 18:29
Návrat hore
Odpovedať s citátom
|
I found similar topics but without working solution.
Is there any way to add custom buttons in View mode to open a new page with parameters based on the current record selected by radio buttons?
I have a table T1 with 3 fields:
T1_ID, T2_ID, T1_text
In view mode of T1 I need a button, which displays T2 with a filter. The filter value should be T2_ID set by the current record of the T1 view.
I can link T2 with the filter, like
http://localhost/T2.php?filtval=2
and in T2.php:
...
//Filtering
$filtval= @$_REQUEST['filtval'];
$opts['cgi']['persist'] = array('filtval' => $filtval);
$opts['filters'] = 'T2_ID REGEXP "^'.$filtval.'"';
...
But how to implement the button in T1.php, which retrieves T1_ID based on selected radio button?
Any idea?
Thanks for help, I really like PME otherwise.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2006-11-08 18:10
Návrat hore
Odpovedať s citátom
|
afaik, the easiest way is to create a virtual field with something like sql="concate('http://jlkjl',T2,'.php')"
|
tszabo
Založený: 07.11.2006
Príspevky: 4
Zaslal: 2006-11-08 21:32
Návrat hore
Odpovedať s citátom
|
| michal Napísal: |
| afaik, the easiest way is to create a virtual field with something like sql="concate('http://jlkjl',T2,'.php')" |
As far as I understand, this is something different.
I need to implement a custom button, which opens a new page with a parameter. This given parameter is stored in a field of the record, selected by the radio buttons. That is, T1 table's i-th record contains a foreign key (T2_ID). T1 view mode has one (or more) custom button, which opens a page T2.php with a parameter "filtval". However, the value of this "filtval" variable should be retrieved from the selected record of T1 table. (Actually, I want to filter out elements with given foreign key from an other table.)
This could be easily solved by making T2_ID field clickable (by 'URL'). But I need more than one button, that is want to open different pages with that single parameter.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2006-11-20 09:02
Návrat hore
Odpovedať s citátom
|
it is impossible to have record values within custom buttons.
however you can make the virtual clickable fields (one or more). afaik it's the only solution (and the only solution i use for this purpose).
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|