How can I set multiple default values for a searchbox having multiselect set to yes

5
But I want to set more values as the default for this select box.  Unfortunately, multi-select search-boxes can only have one default value. What I want is exactly as Roy Veenvliet described in his good idea: https://forum.mendix.com/link/ideas/915  Please upvote this idea. In the meantime, my question is: Is there a workaround for setting multiple values as the default for this missing functionality?
asked
1 answers
2

Hi Tim, we also faced this issue and came up with a JS solution (the setTimeout has to be replaced with something better)

 

setTimeout(
	function(){
		var n=dojo.query('.mx-name-FindAndOverride .mx-selectbox')[0]
			var w=dijit.byNode(n)
			var i=w.items;
			i[0].selected=true;
			i[1].selected=false;
			i[2].selected=true;
			i[3].selected=true;
			i[4].selected=true;
			i[5].selected=true;
			i[6].selected=true;
			i[7].selected=true;
			w._setItemsAttr(w.items)
			var grd=dijit.byNode(
			    dojo.query('.gridManip')[0]
			);
			grd.eventSearchActivated(new Event("click"))
	},
	1000
)

 

answered