Open ghost opened 11 years ago
If you'd like to make an help-article, could you explain the solution a bit better so that no that experienced users can experiment with it as well?
This might work in your situation, but is not compatible with other setups :-(
besides that, props for being prepared to help other enthusiast jtable users!
Let's say you have a table somewhere in your mysql database where you have id's and name's. Id's are numerical values (unique values) and names are the possible options for a select box.
query this table in php and create an array in php format as $array["id"]="name". json_encode the array and echo the results where you would write the options for the select in the first place.
This is plain stuff for not writing 20 or 30 options for a select. Get them from mysql. The function above does just that in a fast way using medoo.php as mysql class and where clauses. Posible for user_id fields.
I used medoo.php class for a faster solution. $column1 could be for example "id" and $column2 could be the names. So you have an array like $select_array[1]=name1,$select_array[2]=name2 and so on... Then we return the array with json_encode. Finally we can use:
to show the options
Please close the issue as this is a solution in php. Outside jtable but effective.