Hello everybody,
I've managed (not without what we could call "hard efforts"...) to make a working multiple-choices lookup.
Within a certain field in Detail-view, you can easily pick up as many choices as you want from another table using the select2 component.
In the Table-view, all the selected choices for the multiple-choices field are listed for each row.
Currently, the quick-search is supported but no filter can be applied on the "multiple-choices" field nor even combined with one or many other filters working on the other fields.
Made with AppGini v5.51
You can test it (add and edit your own records) at the following URL :
http://recoin.org/testdb/
Username : testuser
Password : 123456
Enjoy !
A working multiple-choices lookup (illimited choices from another table)
-
- Posts: 11
- Joined: 2015-09-24 14:06
Re: A working multiple-choices lookup (illimited choices from another table)
Yes!
Exactly what I am looking for. How do You procede in order to make it?
Très intéressant comme outil.
Exactly what I am looking for. How do You procede in order to make it?
Très intéressant comme outil.
Re: A working multiple-choices lookup (illimited choices from another table)
I'm also very interested by this hook.
Could you share your code somehow, please?
Thanks
Could you share your code somehow, please?
Thanks
- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
Re: A working multiple-choices lookup (illimited choices from another table)
Hello, I wrote the following code in:
tablename_dml.php
the code work fine but i don´t know if is correct.
Problem: the code is not in a hook file therewere is erased when compile again
thanks
Alejandro
tablename_dml.php
Code: Select all
// combobox: TAG (TAG is the name field in the tablename)
$combo_TAG = new Combo;
$combo_TAG->ListType = 3;
$combo_TAG->MultipleSeparator = ', ';
$combo_TAG->ListBoxHeight = 10;
$combo_TAG->RadiosPerLine = 1;
if(is_file(dirname(__FILE__).'/hooks/Materiales.TAG.csv')){
// I create the file Materiales.TAG.csv in the hook folder to activate this part of code and coment part of orginal code
// $TAG_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/Materiales.TAG.csv')));
// $combo_TAG->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($TAG_data)));
// this is the added part
$res = sql("SELECT Nombre FROM Categorias", $eo);
while($row = db_fetch_array($res))
{
$inspector[] = $row['Nombre'];
}
$combo_TAG->ListItem = $inspector;
// to here
$combo_TAG->ListData = $combo_TAG->ListItem;
}else{
$combo_TAG->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("A;;B;;C;;D;;E;;"))); // this is the original list of elements
$combo_TAG->ListData = $combo_TAG->ListItem;
}
$combo_TAG->SelectName = 'TAG';
Problem: the code is not in a hook file therewere is erased when compile again
thanks
Alejandro
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
Re: A working multiple-choices lookup (illimited choices from another table)
@samrainbow as I digging detail on your page there is get_tags.php file that call in the json script part
So is not just using the select2 component
So is not just using the select2 component