Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleOutput widget - Programmatically
linenumberstrue
function drawDatefield() {
    let canvas = $('<div />').addClass('widget-container');
    var readOnly = false;
    $('<label />', {
        'for': 'w4w1',
        'text': 'DateDatefield field exampleExample'
    }).appendTo(canvas);
    var inputContainer = $('<div />').addClass('widget input dateinput');
    inputContainer.appendTo(canvas);
    var canvasInput = $('<input />', {
        'id': 'w4w1',
        'type': 'text',
        'disabled': readOnly,
        'placeholder': appConfig.dateFormat
    }).addClass('input').appendTo(inputContainer);
    canvasInput.datepicker({
        changeMonth: true,
        changeYear: true,
        yearRange: "c-100:c+100",
        dateFormat: 'yy-mm-dd'
    });
    canvas.appendTo($('#embeddedComponentContent'));
}