当前位置: 代码迷 >> .NET新技术 >> easyui 动态生成列赋值有关问题
  详细解决方案

easyui 动态生成列赋值有关问题

热度:402   发布时间:2016-04-25 01:24:53.0
easyui 动态生成列赋值问题


 function AddGird() {
        var Year = $("#txtYear").val();
        if (Year == "") {
            $.messager.alert("友情提示", "请选中目标年份!");
            return;
        }
        var days = $("#setQuarter").combobox('getValue');
        List = SpiltType('@ViewBag.GoodsTypeList');
        var targetList = "";
        var st = [];
        var ss = [];
        var fs = 0;
        if (days <= 1) {
            fs = 1;
            days = 12;
        } else {
            fs = days - 2;
        }

        var p = targetlist;

        for (var i = fs; ; i++) {
            var day = i;
            if (i < 10)
                day = "0" + i;
            if (i == days) {
                st.push({ title: Year + "-" + day, colspan: List.length });
                for (var yi = 0; yi < List.length; yi++) {
                    if (List[yi] != "") {
                        var GoodsTypeId = List[yi].split(',')[1];
                        var de = Year + "-" + day;
                        ss.push({
                            field: List[yi].split(',')[1] + day, title: List[yi].split(',')[0], width: 50, align: 'right', editor: { type: 'numberbox', options: { precision: 2 } }
                        });
                    }
                }
                break;
            }
            else {
                st.push({ title: Year + "-" + day, colspan: List.length });
                for (var yi = 0; yi < List.length; yi++) {
                    if (List[yi] != "") {
                        var GoodsTypeId = List[yi].split(',')[1];
                        var de = Year + "-" + day;
                        ss.push({
                            field: List[yi].split(',')[1] + day, title: List[yi].split(',')[0], width: 50, align: 'right', editor: { type: 'numberbox', options: { precision: 2 } }
  相关解决方案