我正在尝试使用新表加载HtmlStore,该表已动态附加到文档(正文)上。
Example Table HTML:
<div id="resultTable"> <table class="basic-table" cellspacing="1" cellpadding="1">
<thead>
<tr class="green-med-dark">
<th>XPLOT</th>
<th>TNODE</th>
<th>TMIN</th>
<th>TS</th>
<th>START_TS</th>
<th>END_TS</th>
<th>RUN_TIME_MINUTES</th>
<th>IDLE_TIME_SECONDS</th>
<th>IDLE_TIME_MINUTES</th>
<th>SQLCODE</th>
<th>NODE</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1931</td>
<td>2</td>
<td>2388</td>
<td>2019-03-20 22:35:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="even">
<td>1932</td>
<td>2</td>
<td>2387</td>
<td>2019-03-20 22:36:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="odd">
<td>1933</td>
<td>2</td>
<td>2386</td>
<td>2019-03-20 22:37:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="even">
<td>1934</td>
<td>2</td>
<td>2385</td>
<td>2019-03-20 22:38:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="odd">
<td>1935</td>
<td>2</td>
<td>2384</td>
<td>2019-03-20 22:39:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="even">
<td>1936</td>
<td>2</td>
<td>2383</td>
<td>2019-03-20 22:40:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="odd">
<td>1937</td>
<td>2</td>
<td>2382</td>
<td>2019-03-20 22:41:00.0</td>
<td>2019-03-20 22:34:27.077061</td>
<td>2019-03-20 22:41:52.407485</td>
<td>7</td>
<td></td>
<td></td>
<td>0</td>
<td>2</td>
</tr>
<tr class="even">
<td>1941</td>
<td>3</td>
<td>2378</td>
<td>2019-03-20 22:45:00.0</td>
<td>2019-03-20 22:44:15.694337</td>
<td>2019-03-20 22:49:02.352217</td>
<td>4</td>
<td></td>
<td></td>
<td>0</td>
<td>3</td>
</tr>
<tr class="odd">
<td>1942</td>
<td>3</td>
<td>2377</td>
<td>2019-03-20 22:46:00.0</td>
<td>2019-03-20 22:44:15.694337</td>
<td>2019-03-20 22:49:02.352217</td>
<td>4</td>
<td></td>
<td></td>
<td>0</td>
<td>3</td>
</tr>
<tr class="even">
<td>1943</td>
<td>3</td>
<td>2376</td>
<td>2019-03-20 22:47:00.0</td>
<td>2019-03-20 22:44:15.694337</td>
<td>2019-03-20 22:49:02.352217</td>
<td>4</td>
<td></td>
<td></td>
<td>0</td>
<td>3</td>
</tr>
<tr class="odd">
<td>1944</td>
<td>3</td>
<td>2375</td>
<td>2019-03-20 22:48:00.0</td>
<td>2019-03-20 22:44:15.694337</td>
<td>2019-03-20 22:49:02.352217</td>
<td>4</td>
<td></td>
<td></td>
<td>0</td>
<td>3</td>
</tr>
<tr class="even">
<td>1945</td>
<td>3</td>
<td>2374</td>
<td>2019-03-20 22:49:00.0</td>
<td>2019-03-20 22:44:15.694337</td>
<td>2019-03-20 22:49:02.352217</td>
<td>4</td>
<td></td>
<td></td>
<td>0</td>
<td>3</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
(直接从Firefox中的“开发人员工具”窗口复制)
这是我在将表追加到正文以将表拉入HtmlStore之后使用的代码:
var hstore = new HtmlStore({
dataId: 'resultTable'
});
我尝试运行以下代码来查看商店中的商品-我得到的只是一个条目:
var gotList = function(items, request){
var itemsList = "";
dojo.forEach(items, function(i){
itemsList += hstore.getValue(i, "name") + " ";
});
console.debug("All items are: " + itemsList);
}
var gotError = function(error, request){
alert("The request to the store failed. " + error);
}
// Invoke the search
hstore.fetch({
onComplete: gotList,
onError: gotError
});
我不知道商店中是否只有一个“田地”?或如何查询商店以添加到图表系列。
基本上-我想了解要插入的表的格式是否错误,或者我只是不了解如何查看数据是否正确存储。