Versions Compared

Key

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

...

Code Block
languagejs
titleOutput widget - Programmatically
linenumberstrue
function drawSelect() {
    var canvas = $('<div />').addClass('widget-container');
    var readOnly = false;
    $('<label />',{
        'for':'w5', 
        'text':'Select label'
    }).appendTo(canvas);
    var input = $('<select />',{
        'id': 'w5', 
        'disabled': readOnly
    }).addClass("widget input select").appendTo(canvas);
    // Add options
    input.append("<option value='null'>Not Specified</option>");
    input.append("<option value='Option_One'>Option_One<Male'>Male</option>");
    input.append("<option value='Female'>Female</option>");
    input.append("<option value='Option_Two'>Option_Two<Other'>Other</option>");
    // Select default
    input.val('Option_OneOther');
    canvas.appendTo($('#embeddedComponentContent'));
}