easyui combox 手动添加项

  $('#comzwcf').combobox({

            valueField: 'id',
            textField: 'text',
        });
        $.ajax({
            url: '/Provider/HandlerIrregularitiesType.ashx?method=list&type=政务处分',
            type: 'post',
            success: function (data) {
                if (data) {
                    var themecombo2 = [{ "id": "-1", "text": "请选择" }];
                    var reldata = eval(data);
                    for (var i = 0; i < reldata.length; i++) {
                        themecombo2.push({ "text": reldata[i].text, "id": reldata[i].id });
                    }
                    $("#comzwcf").combobox("loadData", themecombo2);
              
                }
            }
        });

 

posted on 2017-07-20 10:51  gwazy  阅读(1632)  评论(0编辑  收藏  举报

导航