BEFORE:
var widget = new OO.ui.DeferredWidget( { "class": "ButtonSelectWidget", "items": [ { "data": 1, "label": "Option 1", "title": "Button option 1", "class": "ButtonOptionWidget" }, { "data": 2, "label": "Option 2", "title": "Button option 2", "class": "ButtonOptionWidget" }, { "data": 3, "label": "Option 3", "title": "Button option 3", "class": "ButtonOptionWidget" } ] } ); $( 'body' ).append( widget.$element );
Should be:
var widget = new OO.ui.ButtonSelectWidget( { "items": [ new ButtonOptionWidget( { "data": 1, "label": "Option 1", "title": "Button option 1" } ), new ButtonOptionWidget( { "data": 2, "label": "Option 2", "title": "Button option 2" } ), { "data": 3, "label": "Option 3", "title": "Button option 3", "class": "ButtonOptionWidget" } ] } ); $( 'body' ).append( widget.$element );