Bootstrap DateTimePicker (2) field cannot be disabled

Bootstrap DateTimePicker (2) field cannot be disabled

zajczajc Posts: 67Questions: 10Answers: 2
edited November 2016 in Bug reports

I'm using Bootstrap DateTimePicker (2) and I found out that the field which is using this plug-in cannot be disabled.

I have a field in editor.

"label": "DATE column",
"name": "date_column",
"type": "datetime"

I would like to disable this field but it is not possible.

editor
    .on('initEdit', function(e, node, data) {
         editor.disable('char_column');
         editor.disable('date_column');
        });

You can find the test case here: https://sup.zajc.xyz/form.test.php You must select the row and click on Edit button and what you can see is that the CHAR column is disabled, but DATE column field is not disabled.

Can you help and post fix for this and include the solution in the next version?

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Add these two functions to the plug-in's object:

        disable: function ( conf ) {
            conf._input.data("DateTimePicker").disable();
        },
    
        enable: function ( conf ) {
            conf._input.data("DateTimePicker").enable();
        },
    

    That should be all that is needed to enable those two methods.

    Thanks for pointing this out. The plug-in will be updated with the next release of Editor.

    Allan

  • zajczajc Posts: 67Questions: 10Answers: 2

    Thanks. It is working now. \o/

This discussion has been closed.