combobox 上下级

   function getQuestionCategories(){     

  var requestUrl="<%=request.getContextPath()%>/customerService/getQuestionCategories";   

   $('#questioncategoryid').combobox({     

  url : requestUrl,     

  valueField : 'id',     

  textField : 'name',     

    groupField : 'parentname',     //最上级显示名称

  groupFormatter : function(group) {      

      return '<span style="color:black">' + group + '</span>';     

  },     formatter : function(row) {      

        var opts = $(this).combobox('options');     

         return " " + row[opts.textField];     

  }

     })   }

posted @ 2017-02-22 10:48  JLCUI  阅读(185)  评论(0编辑  收藏  举报