How to integrate tokenfield JS with datatable editor and datatable?

How to integrate tokenfield JS with datatable editor and datatable?

IHSLIHSL Posts: 13Questions: 8Answers: 0

I would like to integrate autocomplete-multi select tag with datatable editor..I have integrated tokenfield js with editor.. I am facing issue while editing a row which contains two comma separated values in a column. How to solve this issue?

  1. What is teh json data format i should maintain
    2.How to integrate tokenfield with editor datatable and datatable for CRUD operation

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    Hi,

    What is teh json data format i should maintain

    You’d need to refer to the tokenfield documentation for that. Do they suppose comma separated values? If not, your integration plug-in for Editor would need to split the value and give tokenfield the resulting array.

    How to integrate tokenfield with editor datatable and datatable for CRUD operation

    How to create a field type plug-in for Editor is discussed in the documentation here.

    Let me know how you get on with it.

    Regards,
    Allan

  • IHSLIHSL Posts: 13Questions: 8Answers: 0

    Do they suppose comma separated values?

    Yes..
    [{ label: 'Allan', value: 'ACFE9DF4-158C-42E8-84B0-2B30386BFFFA' }, { label: 'Pradeepa', value: '14874F87-695E-4E1C-AD3B-86F11C507E0E' }, { label: 'Nagendra', value: 'CCFE9DF4-158C-42E8-84B0-2B30386BFFFA' }, { label: 'David', value: 'DCFE9DF4-158C-42E8-84B0-2B30386BFFFA' }];

    While adding teh data it is working perfectly fine, but when we try to edit the row, it picks up the comma separated label as it is.. actually it should pick up VALUE for the already added comma separated items

  • IHSLIHSL Posts: 13Questions: 8Answers: 0
    edited February 2021
    1. I have a json file where developer column values are maintained as array
      .

    2. Onloading teh datatable, it will look like this


    3.While adding new item

    4.when you inspect the add pop up , you will see data-value as the **VALUE **and label as the plain text as per json

    5.But when you edit the existing row, the data-value is teh label instead of Value.. how to resolve this issue

    I need to have data-value as **Value **instead of Label when the row is in edit state

  • IHSLIHSL Posts: 13Questions: 8Answers: 0

    hi @allan thanks for the input. I created custom field and worked on my requirements.. it works fine.. i will share the solution here so that it will help community members

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    That would be fantastic - thanks. Good to hear you got it working.

    Allan

This discussion has been closed.