The new editor template does not work with Selectize
The new editor template does not work with Selectize
I have been struggling to get selectize to work with editor recently which was not so difficult in the past. I found out that the editor template :
new $.fn.dataTable.Editor({
ajax:
{
url: 'some_editor_end_point',
data: function ( d ) {
if ( selected.any() ) {
...more data fields
}
}
},
table: '#tablename',
template: '#customForm',
fields:
[
{
label:'Country of Residence',
name: 'Countries[].ID',
type: 'selectize',
className:'countryOfResidence',
opts: {
searchField:'label',
valueField:'value',
maxItems: null
}
]
......
<div id="customForm">
<div data-editor-template="Countries[].ID"></div>
How I know is that I removed the template call from the editor init:
// template: '#customForm',
and I got selectize to work. Is there a work around to this? I find template very convenient and would not want to switch back at this point.
This discussion has been closed.
Answers
What is also interesting is that when I go the
method, the select is shown in the editor. When I go the:
no data is even loaded in the html select that is hidden. I even tried loading data manually through the
js.
options: [],
property but that does not work either.
Interesting. I'm afraid I don't have an immediate answer for you here, but I'll look into it and get back to you.
Allan