Double Edit Button - Is this possible?

Double Edit Button - Is this possible?

rmeetinrmeetin Posts: 100Questions: 24Answers: 1

I have some forms that are rather long and would make sense to separate the data into 2 separate editors. Is this possible with the editor?

Add basic - will edit basic fields
Add advanced - will edit various other fields

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @rmeetin ,

    Instead of two different forms, you could use dependent() instead to determine which fields to show in a single form - something like this. Would that work?

    Cheers,

    Colin

  • rmeetinrmeetin Posts: 100Questions: 24Answers: 1

    Hmmm not sure; that is kind of an intriguing option and it will certainly have some utilization with other needs. In the example it shows limited vs extended views. For the purpose in mind I would be looking a two separate views like Group A and Group B.

    If with the Show Options you could do Group A and Group B that might get you there.

  • allanallan Posts: 61,695Questions: 1Answers: 10,102 Site admin

    You can do as you originally suggested as well as the method Colin pointed out. It really depends how you want to display the UI to the end user (another option would be to use a custom form layout with tabs or similar).

    To implement your original approach, the best way is simply to create two Editor instances and then assign them to different edit buttons:

                { extend: "edit", text: 'Basic editing', editor: editorSimple },
                { extend: "edit", text: 'Complete editing',  editor: editorComplete },
    

    Allan

  • rmeetinrmeetin Posts: 100Questions: 24Answers: 1
    edited September 2019

    Do you have an example showing how to set up tabs in the popup editor? Then I could yuse the tabs to categorize/group the fields.

    Tab 1 - basic info
    Tab 2 - textarea stuff
    Tab 3 - uploads

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @rmeetin ,

    There's not an example with tabs on the edit pane - I don't believe that would be possible. As Allan said, the best bet would be to have two buttons, each with their own Editor instances.

    Cheers,

    Colin

  • allanallan Posts: 61,695Questions: 1Answers: 10,102 Site admin
    Answer ✓

    Actually... While a tab layout in the editing form is not something that is built into Editor, it is possible to do with a custom template. Just use a tab library (or write your own) and embed that into the template.

    Allan

  • rmeetinrmeetin Posts: 100Questions: 24Answers: 1

    My contractor figured this out with your hint. Honestly I would like to see more examples of applying these functions and some of the others that I don't understand because I am not javascript-skilled. Live examples are a good thing.

This discussion has been closed.