Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82446

Selectize plug-in, multiple value, deselect all does not sent null to backend

$
0
0

We are using Selectize plug-in and it works normally very well. However when using it with multi values we have a problem in case the user decides later to remove all values. If nothing is selected, the editor POST does not post null for this field but rather skips it. In consequence the editor backend is not changing the value from something to null. How can I force the plugin to post a value on edit back to the server even nothing was selected?

Cases:
- Change from nothing (null) to something OK
- Change from something to something else OK
- Change from something to nothing (null), NOK, no change finally in the DB as this value is not posted to the server

I have implemented a check in pre-edit of the backend, if not posted, set to null. But if we are using inline Editing, anyway the full form is not sent and then my check removes the values.

Maybe this can be fixed on pre-submit of the editor, but how can I force him to consider this field, even if it is empty?

Many thanks in advance.

 slectize_opts = {
        plugins: ['remove_button','restore_on_backspace'],
        delimiter: '|',
        maxItems: 100,
        persist: false,
        valueField: 'VALUE',
        labelField: 'LABEL',
        searchField: 'LABEL',
        create: true,
        render: {
            option: function(item, escape) {
            ...
            }
        },

        load: function(query, callback) {
        ...
        }
    };



"fields": [
      ...
      ,{
        label: ...
        type:  "selectize",
        opts: slectize_opts_RELATED_ID
       }


Viewing all articles
Browse latest Browse all 82446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>