我想在Durandal app中添加Vu-Meter Gauge图表.我将高图表Js代码保存在"viewAttacthed"中.我的Js代码如下所示:
define(['services/logger'], function (logger, highcharts) {
//#region Internal Methods
function activate() {
logger.log('Reports View Activated', null, 'Resources', true);
return true;
}
//#endregion
function viewAttached(view) {
$('#ufcGaugeChart', view).highcharts({
chart: { type: 'gauge' },
title: null,
pane: [{
startAngle: -90,
endAngle: 90,
center: ['50%', '67%'],
size: 175
}],
yAxis: [{
min: 0,
max: 100000,
minorTickPosition: 'inside',
tickPosition: 'inside',
labels: {
rotation: 'auto',
distance: 20
},
plotBands: [{
from: 0,
to: 40000,
color: '#679b4f',
innerRadius: '100%',
outerRadius: '105%'
}, {
from: …Run Code Online (Sandbox Code Playgroud) javascript jquery highcharts single-page-application durandal
我试图使用knockout observable array在网页中显示大约5000条记录,这需要花费很多时间,
有没有办法处理这个没有分页?
请帮忙..
视图模型中的JS代码,数据来自gridData源中的ajax调用:
groupGrid.prototype.updateGrid = function (gridDataSource, groupGridOptions) {
var self = this;
self.ColumnName(groupGridOption.ColumnNameList); // List of column name available in the data source.
self.gridData(gridDataSource); // taking time while executing this code
self.totalRowCount(self.gridData().length);
self.selectedItems.removeAll();
self.selectedRowCount(0);
};
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<tbody class="ngTBody" data-bind="foreach: gridData">
<tr class="ngdatarow">
<td>
<span class="nameHeader" data-bind="text: $data[$root.ColumnName()[0]], click: $root.gridNameClick" style="cursor: pointer; text-decoration: underline"></span>
</td>
<td>
<span class="displayBlock" data-bind="text: $data[$root.ColumnName()[1]]"></span>
</td>
<td>
<span class="displayBlock" data-bind="text: $data[$root.ColumnName()[3]"></span>
</td>
</tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)