Edit in View Only mode

Edit in View Only mode

rldean1rldean1 Posts: 141Questions: 66Answers: 1
edited July 2019 in Editor

Is there an easy way to open an Editor in "view only" mode? (Kind of like a property sheet)

Additionally, is there a way to get this button function into formOptions? What I mean is, is there a way to configure Editor buttons in its instantiation?

            dteEffectiveDates = new $.fn.dataTable.Editor({

            // can I configure form buttons here?  Can I get a button function here?

            }).on('preOpen', function (e, mode, action) {

                switch (action) {
                    case 'edit':

                        // disable editing if Locked
                        if (recordLocked) {

                            // disable all fields
                            dteEffectiveDates.disable();

                            // $('div.DTE_Form_Buttons button').attr('disabled', true);

                            // change what the Update button does
                            dteEffectiveDates.buttons({
                                text: 'OK',
                                action: function () {
                                    this.close();
                                }
                            });


                        } else {
                            dteEffectiveDates.enable();
                        };
                        break;
                    default:
                        //do nothing
                        break;
                };

            });

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @raydlevel5 ,

    I think we covered this in your other threads, here and here. If I'm missing something can you explain the difference please,

    Cheers,

    Colin

  • rldean1rldean1 Posts: 141Questions: 66Answers: 1

    In summary:

    • I would like to suggest a feature: Specifically, a setting that opens an Editor form in "View Only" mode. Perhaps established as a function editor.viewOnlyMode(), or a 4th action: Create, Edit, Remove, and View.
    • I would like to know if you can configure a function for a Form button in Editor via formOptions.main or form-options.

    I promise to leave you alone for a while. Thank you for being there for me. I'm kinda a noob all alone in a corner. Sometimes they let me go outside. :)

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

    Hi,

    Agreed - this is something we've actually got in our feature tracker already, but no target release for it I'm afraid.

    Allan

This discussion has been closed.