Hook a Lookup table for select box control type
Hook a Lookup table for select box control type
darshitj2
Posts: 10Questions: 2Answers: 0
Hi All,
Is there any way i can hook a lookup table for some columns in the Datatables ?
This discussion has been closed.
Replies
Hi @allan could you throw some light on this?
@allan could you please help me with this?
Not sure what exactly you mean with lookup table. If it is simple options to select for a field in Editor read from a database, a file or hard-coded then these examples will help you out:
- read from database
https://editor.datatables.net/examples/advanced/joinLinkTable.html
- hard coded options:
https://editor.datatables.net/examples/simple/fieldTypes.html
if you want to be able to enter search text into the "look up" field use the selectize plug-in instead of the select field.
code example:
JavaScript - the options database contains up to 20,000 records; a maximum of 15 records is sent to the front end based on user entry of the department name. The user cannot create a department (create: false).
server side:
Thanks @rf1234 fro quick response.
We generally use Datatables to show data. Here I am talking about a scenario where i want to edit the existing data.
Suppose there is one column 'CITY' in Datatables. Now i want to a value in a select box format rather than plain text.
So i just want to know is there any way i can bind the list of cities to each cell in that column ('CITY') and whatever the current value of cell is, it will be the selected value.
Use Editor with inline editing and the options instance as described above. That will allow you to set the value for each cell in the column also with a select box I guess. Should be no problem at all.
Hi darshitj2 - are you using Editor at all for this? I don't actually see an Editor license for your account, so I'm guessing not?
With Editor you would use a
select
field, probably with a leftJoin as rf1234 suggests.If you aren't using Editor, then you'd need to modify whatever code base you are using to do the edit to support what you need.
Allan
Thanks @allan @rf1234 for your suggestions.
I am new to it.
Can anyone of you tell me how to get license for editor and further?
https://editor.datatables.net/