【问题标题】:How to change some data on the table?如何更改表中的一些数据?
【发布时间】:2018-04-17 21:09:51
【问题描述】:

我正在尝试将显示在表格上的信息更改为显示在表格左侧的信息 <td>。这是我的代码:

var tableData = [
                        [null],
                        ["${apiInstanceList[0].serverName}"],
                        ["${apiInstanceList[1].serverName2}"]
                    ];

                    var cheapestByAirlineByLeg_data1 = [];
                    var cheapestByAirlineByLeg_data2 = [];
                    var cheapestByAirlineByLegChart = anychart.column();

                    <g:each in="${apiInstanceList}" var="apiInstance">
                        <g:each in="${apiInstance.cheapestByAirlineByLegMap}" var="leg">
                            var entry  = [];
                            entry.push("${leg.legs}");
                            entry.push("${leg.price}");

                            <g:if test="${apiInstance.id % 2 == 0}">
                                cheapestByAirlineByLeg_data2.push({x: entry[0], value: entry[1]});
                                tableData[0].push(entry[0]);
                                tableData[1].push("$"+entry[1]);
                            </g:if>
                            <g:else>
                                cheapestByAirlineByLeg_data1.push({x: entry[0], value: entry[1]});
                                if(tableData[0].indexOf(entry[0]) == -1){ tableData[0].push(entry[0]); }
                                tableData[2].push("$"+entry[1]);
                            </g:else>
                        </g:each>
                    </g:each>[enter image description here][1

这是查看页面的方式。例如,我无法将 de [B6, B6] 更改为 GDSQA1。

【问题讨论】:

    标签: html html-table datatables anychart


    【解决方案1】:

    您应该像列数组一样使用初始数据表,而不是行。 然后您应该更改将数据推送到 tableData 的顺序。你应该推到列,而不是行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多