Using the separator option with MULTIPLE

Using the separator option with MULTIPLE

arichardsonarichardson Posts: 16Questions: 3Answers: 0
edited November 2015 in Editor

My Editor works fine, and I am able to use the multiple option to allow the user to make multiple choices.

However, when I add the separator option, the editor stops working. How do I use this option?

All the documentation says is to provide a separator value:

(From http://editor.datatables.net/reference/field/select)

When the multiple option is enabled values selected from the select list are submitted to the server as an array of values, but you might wish to simply store the selected values in a text field. For this, set a value for the separator parameter (typically a pipe or a comma) and Editor will implode the values of the array into a string. It will also read multiple values from a similarly formatted string.

Here's a sample of my code:

{
       label: "Reviewers:",
       name: "REVIEWERS",
        options:{   
        },
        type: "select",
        multiple: true,
        separator: ","                              
}

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    Could you describe in what way it stops working? Do you get an error in the browser's Javascript console, or does something else happen? Are you able to give me a link to the page so I can debug it directly?

    Thanks,
    Allan

  • drashtidrashti Posts: 1Questions: 0Answers: 0

    I also have same issue like this. When I am using the 'Separator' option with multiple type select field, it is not working. Creating a new record works fine, but whenever I click on "Edit" button, it gives "Uncaught TypeError: Cannot read property 'join' of null" error at "dataTables.editor.min.js:680" in console. And also on clicking on "Edit" button, editor is not displaying.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Thanks for the details - let me try to reproduce the issue and I'll get back to you!

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    Sorry for the delay in replying here - I've tracked the issue down now and the fix will be in 1.5.4 which I plan to release tomorrow. It came about from using join on a jQuery instance (or in earlier versions, on the result from $().val() which could be null).

    Allan

  • memamema Posts: 8Questions: 2Answers: 0

    Thx.. Looking forward to the new version. :-)

This discussion has been closed.