一个js中有两个 Grid,html中对于第二个引用 不显示,控制台报错 Cannot find the host element.
第一个:
// initialize the grid
var theGrid = new wijmo.grid.FlexGrid('#theGrid', {
columns: [
{ binding: 'indexName', header: '指数名称' },
{ binding: 'totalIncomeIndex', header: '总收益指数' },
{ binding: 'totalIncomeRate', header: '总收益指数涨跌幅(%) ' },
{ binding: 'fullPriceIndex', header: '全价指数', format: 'n0' },
{ binding: 'fullPriceIndexRate', header: '全价指数涨跌幅(%)' },
{ binding: 'netPriceIndex', header: '净价指数' },
{ binding: 'netPriceIndexRate', header: '净价指数涨跌幅(%)' },
{ binding: 'showDate', header: '日期', format: 'n0' },
{ binding: 'showTime', header: '时间', format: 'n0' },
],
autoGenerateColumns: false,
itemsSource: view,
selectionMode: wijmo.grid.SelectionMode.Row
});
第二个:
var theGridColumn = new wijmo.grid.FlexGrid('#theGridColumn', {
columns: [
{ binding: 'bondName', header: '债券简称' },
{ binding: 'bondCode', header: '债券代码' },
{ binding: 'period', header: '待偿期(年)' },
{ binding: 'fullPriceOfDay', header: '日间估价全价', format: 'n0' },
{ binding: 'fullPriceOfDayRate', header: '日间应计利息' },
{ binding: 'netPrice', header: '估价净价' },
{ binding: 'netPriceRate', header: '估价收益率' },
{ binding: 'fullPriceOfDay', header: '日终估价全价' },
{ binding: 'fullPriceOfDayRate', header: '日终应计利息' },
{ binding: 'showDate', header: '日期', format: 'n0' },
{ binding: 'showTime', header: '时间', format: 'n0' }
],
autoGenerateColumns: false,
itemsSource: data1,
allowResizing: 'None'
});
html:
<div id="content" style="margin:100px 100px 100px 280px;">
<div id="theGridColumn"></div>
</div>
|
|