Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.11k stars 4.94k forks source link

Set Selected Value For Multiple Select with Other Initialization Paramaters #6978

Closed cupcakedream closed 4 years ago

cupcakedream commented 4 years ago

Hey All -

I'm trying to set selected values for a multiple select dropdown but I can't seem to figure out how to do this during initialization. I know I can do it after initialize but I want to avoid firing an onchange event at all costs. I've looked everywhere can't seem to figure out how to do this. Is it not supported?

    jQuery('.outcome select').dropdown({
        selected : [1,2,3,4,5],
        onChange : function( x,y,z ) {
            jQuery.ajax({ url : 'ajax.php', method : 'post',
                data : { action : 'outcome', id : y }
            });
        }
    });
iamareebjamal commented 4 years ago

Semantic-UI has been deprecated for years now, please use fomantic UI

lubber-de commented 4 years ago

@iamareebjamal He already posted the same issue at Fomantic-UI and it is already answered, solved and even fixed with an additional PR there 😉 https://github.com/fomantic/Fomantic-UI/issues/1470 https://github.com/fomantic/Fomantic-UI/pull/1471

iamareebjamal commented 4 years ago

Great 👍😊

cupcakedream commented 4 years ago

Yup it's all set, thanks all!