Edit in View Only mode

Edit in View Only mode

raydlevel5raydlevel5 Posts: 98Questions: 43Answers: 1
edited July 18 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: 6,818Questions: 0Answers: 1,167

    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

  • raydlevel5raydlevel5 Posts: 98Questions: 43Answers: 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: 50,842Questions: 1Answers: 7,620 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

Sign In or Register to comment.