jquery easyUI combobox多选回调赋值

  设置多个值:
$(function(){//jquery easyui 设置回调多选值
			   var t = [];  
			   <c:forEach items="${clientArticle.tags}" var="tag" varStatus="status">  
			   t["${status.index}"] = "${tag.id}";  
			   </c:forEach>  
			 $('#tagIds').combobox('setValues',t);  
		   });


  

   类别:
						  <select class="easyui-combobox" name="tagIds" id="tagIds"
						   style="width:100px;" data-options="textField:'text', multiple:true,panelHeight:'auto'">
						     <s:iterator value="#tags">						     
				                 <option value="${id}">${name}</option>
						     </s:iterator>
						       
						    </select>

设置单个值:

  $(function(){//设置 "出处" 进行单选回调
			 $('#tag').combobox('setValue',"${tagId}");  
		  });


    类别:
		     <select class="easyui-combobox" name="tagId" id="tag"
		      style="width:100px;" data-options="textField:'text',panelHeight:'auto'">
		       <option value="" selected="selected">无</option>
		       <s:iterator value="#tags">
				      <option value="${id}">${name}</option>
		       </s:iterator>
		       </select>




你可能感兴趣的:(jquery,easyui,combobox)