Using separate editor modals for create and edit

Using separate editor modals for create and edit

Stacey1134Stacey1134 Posts: 101Questions: 18Answers: 0

Can you direct me to an example that shows how to use different editor UI modals for create and edit buttons? I have a nested editor within my main editor that is not relevant for editing existing records. Thanks. Also a link to resizing textares and form elements would be great as well.

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,809Questions: 85Answers: 406
    edited December 2022 Answer ✓

    I don't think there are examples but the solution is rather simple. You just define two Editors for the same Data Table and then use one for "edit" and the other one for "create".

    I use quite a few Editors for one of my data tables - and it doesn't cause any issues.

    Here is the buttons list of one of my data tables:

    buttons: [
        {   extend: "create", editor: subEditor, className: "editorOnly mainBtns", name: "createSub"},
        {   extend: "edit", editor: subEditor, className: "editorOnly mainBtns", 
            text: lang === 'de' ? 'Basis' : 'Base' },
        {   extend: "edit", editor: subAppEditor, className: "editorOnly mainBtns", 
            text: lang === 'de' ? 'Antrag' : 'Application' },
        {   extend: "edit", editor: subExecEditor, className: "editorOnly mainBtns", 
            text: lang === 'de' ? 'Bewilligung' : 'Execution' },
        {   extend: "edit", editor: subProofEditor, className: "editorOnly mainBtns", 
            text: lang === 'de' ? 'Verwendung' : 'Usage' },
        {   extend: "edit", editor: subAcctEditor, className: "editorOnly mainBtns hidden", 
            text: lang === 'de' ? 'FiBu-Daten' : 'Acctg.-Data', name: "enterAcctData" },
        {   extend: "subOrder", className: "editorOnly mainBtns hidden", name: "enterOrderData" },
        {   extend: "edit", editor: subTablesEditor, className: "editorOnly mainBtns", 
            text: lang === 'de' ? 'Basistermine' : 'Basic Due Dates' },
        {   extend: "copySub", editor: subEditor, className: "editorOnly", name: "copySub" },
        {   extend: "softDelete", editor: subEditor, className: "editorOnly" },
        {   extend: "showDeleted", className: "premiumSubscriptionOnly" },
        {   extend: "recover", editor: subEditor, className: "editorOnly" },
        {   extend: "hideDeleted", className: "premiumSubscriptionOnly" },
        {   extend: "excelSubReg", split: ["excelSubRegVisible", "excelSubRegNoChildRows"] },
        {   extend: "ctrCategoryWithValueRange", className: "editorOnly" },
        {   extend: "ctrEvent", className: "editorOnly", name: "taskButton" },
        {   extend: "editComments", editor: ctrCommentsEditor, className: "editorOnly", 
            text: lang === 'de' ? 'Kommentar / Beschreibung' : 'Comment / Description' },
                    "toggleWidth",
                    "deleteState",
                    "clipboard",
        {   extend: "colvis", columns: ':not(.never, #minTaskDueDate)' }
    ],
    
  • Stacey1134Stacey1134 Posts: 101Questions: 18Answers: 0

    Cool! Thanks!

Sign In or Register to comment.