const tabHolder = document.getElementById("stocklib-tab-container");
const stockClient = new StockLib.Client('194.67.91.14:1313');
stockClient.listFields().then((response) => {
}).catch(e => console.error(e));
stockClient.listSecurities({
fields: ['BOARDID', 'SECID', 'ISIN', 'SECNAME'],
filter: 'SU26232RMFS7'
}).then(response => {
})
stockClient.connect().then(() => {
const columns = [
{id: 'SECID', key: true, caption: 'Security', className: 'security', style: {width: '170px'}},
{id: 'SHORTNAME', caption: 'Short name', className: 'shortname', style: {width: '100px'}},
{id: 'SECNAME', caption: 'Security name', className: 'secname', style: {width: '200px'}},
{id: 'OPEN', caption: 'Open', style: {width: '200px'}},
{id: 'HIGH', caption: 'High', style: {width: '200px'}},
{id: 'LOW', caption: 'Low', style: {width: '200px'}},
{id: 'VALUE', caption: 'Value', style: {width: '200px'}},
{id: 'BOARDID', key: true, hidden: true}
];
const sortFunc = (rows) => {
return rows.sort((a, b) => {
return a.SECID > b.SECID ? 1 : a.SECID < b.SECID ? -1 : 0;
});
};
const stockTable = new StockLib.Table(tabHolder, stockClient, currentType, columns, sortFunc);
stockTable.onHeaderCellClick((e) => {
});
stockTable.onCellClick((e) => {
});
});