Set Editor defaults

Set Editor defaults

Loren MaxwellLoren Maxwell Posts: 387Questions: 94Answers: 10

For all my Editor forms, I'm trying to set the default for formOptions.main.onBlur to 'none'.

I've been through a half a dozen or so variations of the following, but don't seem to be able to stumble across the exact statement I need to make:

$.extend( true, $.fn.dataTable.Editor.formOptions, {
    main: {
       onBlur: 'none'
    }
});

What would be the correct way to update the defaults?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓
    $.extend( true, Editor.defaults, {
        formOptions: {
            main: {
                onBlur: 'none'
            }
        }
    });
    

    should do it.

    Allan

  • Loren MaxwellLoren Maxwell Posts: 387Questions: 94Answers: 10

    Thanks, @allan!

    Works great after just a slight correction to $.fn.dataTable.Editor.defaults:

    $.extend( true, $.fn.dataTable.Editor.defaults, {
        formOptions: {
            main: {
                onBlur: 'none'
            }
        }
    });
    
  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    Oh sorry yes. I was thinking of a module import. DataTable.Editor.defaults would work in the browser as well as $.fn.dataTable.

    Allan

Sign In or Register to comment.