How can i add dynamic field datatables editor ?

How can i add dynamic field datatables editor ?

veryjacksonveryjackson Posts: 19Questions: 5Answers: 0
edited February 2017 in Editor

I search but i cant found i want add button and creat new fields with array?

like that:formvalidation.io/examples/adding-dynamic-field/

Thank you

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394
    edited February 2017

    Your reference link is about adding fields to a form. I'm not sure how you want to relate that to DataTables.

    EDIT: my apologies, I see that you are referring to Editor, which I don't use so can't help.

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    You can use the add() method to add fields to an Editor form dynamically. The converse of that is the clear() method which can be used to remove fields.

    Regards,
    Allan

  • veryjacksonveryjackson Posts: 19Questions: 5Answers: 0
    edited February 2017

    Thank you allan so how can i use that server-side php ?

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    I'm afraid I don't really understand the question. Your server-side PHP would need to know what fields can be sent by the server-side. The methods I linked to above are client-side methods which will add and remove fields from the client-side form.

    Allan

  • veryjacksonveryjackson Posts: 19Questions: 5Answers: 0

    Hİ allan i want
    like this i want save same row in database like array if user want a lot product

    <input type="text" name="product[]">
    <input type="text" name="product[]">
    <input type="text" name="product[]">

    i maen like this i need example how can i do with datatables editor

    Thank you

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    Thanks for the clarification - I understand now. That is not a feature that Editor currently has built in, but it is something that you would be able to create through a custom field type plug-in.

    Allan

  • veryjacksonveryjackson Posts: 19Questions: 5Answers: 0

    Sorry but i cant do this, do you have example ? Thank you ?

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    No, sorry. As I mentioned above, that isn't something that is currently built into Editor, so it isn't something I've got an example of. It would need a custom field type to be created.

    Allan

This discussion has been closed.