0

我需要制作自定义表来安排人员行和天数列。将实施附加逻辑来填充单元格。每个单元格都保存有关谁在特定日期在特定班次中参与的信息(可以是更多班次)。

实际上,我需要一种将值存储在某个控件(例如我的自定义 html 标记)、隐藏字段或其他东西中的方法。计划后,相同的单元格将填充额外的数据(实现的日期时间开始,实现的日期时间结束)。

最后一步是获取所有值并存储到数据库。

你怎么看?你有什么建议或类似的案例吗?

4

2 回答 2

0

你的意思是喜欢在运行时创建表如果是这样我认为这段代码会帮助你

   var Products = response.value;
            var s = new Array();
            s[s.length] = "<table id='Productss' border = 1 bgcolor='Grey'>";
            s[s.length] = "<th>" + "Product ID" + "</th>";
            s[s.length] = "<th>" + "Product Name" + "</th>";
            s[s.length] = "<th>" + "Unit" + "</th>";
            s[s.length] = "<th>" + "Reorder Level" + "</th>";
            s[s.length] = "<th>" + "Supplier Name" + "</th>";
            s[s.length] = "<th>" + "Unit Price" + "</th>";
            s[s.length] = "<th>" + "Units In Stock" + "</th>";
            s[s.length] = "<th>" + "Units On Order" + "</th>";
            for (var i = 0; i < Products.length; i++) {
                s[s.length] = "<tr>";
                s[s.length] = "<td>" + Products[i].ProductID + "</td>";
                s[s.length] = "<td>" + Products[i].ProductName + "</td>";
                s[s.length] = "<td>" + Products[i].UnitName + "</td>";
                s[s.length] = "<td>" + Products[i].ReorderLevel + "</td>";
                s[s.length] = "<td>" + Products[i].SupplierID + "</td>";
                s[s.length] = "<td>" + Products[i].UnitPrice + "</td>";
                s[s.length] = "<td>" + Products[i].UnitsInStock + "</td>";
                s[s.length] = "<td>" + Products[i].UnitsOnOrder + "</td>";
                s[s.length] = "</tr>";
            }
            s[s.length] = "</table>";
            document.getElementById("DisplayResult").innerHTML = s.join("");


    }

var Products Its Avariable Describes The Return Of Ajax Method And I Draw Table with JAvascript And Join It In span And Thats The Code Of joining

   document.getElementById("DisplayResult").innerHTML = s.join("");

Let Me Know If Any Thing Not Clear

于 2012-10-22T08:26:08.867 回答
0

I solved my problem with values putted in ID field. Custom function parse same ID field and extract necessary values.

于 2012-10-26T08:14:41.043 回答