Hot to show dropdown (select-box) in view mode of editor
Hot to show dropdown (select-box) in view mode of editor
ambad
Posts: 3Questions: 1Answers: 0
Hi,
I have a question regarding this example:
https://editor.datatables.net/examples/inline-editing/join.html
If I click on the location, a dropdown of possible locations is shown.
Is it also possible to show the locations dropdown in view mode already?
I know, that I could use the render-parameter of datatable itself but this does'nt work with the select-type of editor. Or am I wrong in this?
Thanks in advance,
Dirk
This discussion has been closed.
Answers
As far as I am aware no. There is no API for the
select
element to make it show from Javascript.The only option is to use a Javascript based alternative such as Select2 or Selectize.
Allan
I'm not sure, if I understand you right. In the given example, we have this configuration of editor for the sites-column
The datatable-configuration looks like this:
{ data: "sites.name", editField: "users.site" }
This shows the site name as a string.
So if I click on the site name, the dropdown will be shown.
To change the datatable rendering from a string to a dropdown, I currently would add a render-configuration
My guess was, that Editor/Datatable has a configuration which already does it.
If you are saying, that Select2 could do this, where would you embed that?
Thanks a lot,
Dirk
I think I might not have understood. Are you looking to have the
select
element display in its "open" state when you click on a cell to edit it?Or are you looking for something more like this - just for select inputs?
Allan
Yes, this is exactly what I am looking for! Are there any examples available (assuming it is possible to do)?
Thanks so far,
Dirk
I don't have an example using a
select
input, but it should just be a case of modifying that example. I don't see any reason why it won't work.Allan