Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createGridSearchService(model: JSONModel): GridSearchService {
const grid = new DataGrid();
grid.dataModel = model;
return new GridSearchService(grid);
}
function createModel(): JSONModel {
return new JSONModel({
data: [
{ index: 0, a: 'other', b: 'match 1' },
{ index: 1, a: 'other', b: 'match 2' }
],
schema: {
primaryKey: ['index'],
fields: [
{
name: 'a'
},
{ name: 'b' }
]
}
});
}
function createGridSearchService(model: JSONModel): GridSearchService {
let fgColorFloatRenderer = new TextRenderer({
font: 'bold 12px sans-serif',
textColor: redGreenBlack,
format: TextRenderer.formatFixed({ digits: 2 }),
horizontalAlignment: 'right'
});
let bgColorFloatRenderer = new TextRenderer({
textColor: heatMapViridisInverse,
backgroundColor: heatMapViridis,
format: TextRenderer.formatFixed({ digits: 2 }),
horizontalAlignment: 'right'
});
let grid1 = new DataGrid({ style: blueStripeStyle });
grid1.dataModel = model1;
grid1.keyHandler = new BasicKeyHandler();
grid1.mouseHandler = new BasicMouseHandler();
grid1.selectionModel = new BasicSelectionModel({ dataModel: model1 });
let grid2 = new DataGrid({ style: brownStripeStyle });
grid2.dataModel = model2;
grid2.keyHandler = new BasicKeyHandler();
grid2.mouseHandler = new BasicMouseHandler();
grid2.selectionModel = new BasicSelectionModel({
dataModel: model2,
selectionMode: 'column'
});
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid2.dataModel = model2;
grid2.keyHandler = new BasicKeyHandler();
grid2.mouseHandler = new BasicMouseHandler();
grid2.selectionModel = new BasicSelectionModel({
dataModel: model2,
selectionMode: 'column'
});
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid3.dataModel = model3;
grid3.keyHandler = new BasicKeyHandler();
grid3.mouseHandler = new BasicMouseHandler();
grid3.selectionModel = new BasicSelectionModel({ dataModel: model3 });
let grid4 = new DataGrid({ style: lightSelectionStyle });
grid4.cellRenderers.update({ 'body': bgColorFloatRenderer });
grid4.dataModel = model4;
grid4.keyHandler = new BasicKeyHandler();
grid4.mouseHandler = new BasicMouseHandler();
grid4.selectionModel = new BasicSelectionModel({ dataModel: model4 });
let grid5 = new DataGrid({
style: greenStripeStyle,
defaultSizes: {
rowHeight: 32,
columnWidth: 128,
rowHeaderWidth: 64,
columnHeaderHeight: 32
}
});
grid5.dataModel = model5;
});
let bgColorFloatRenderer = new TextRenderer({
textColor: heatMapViridisInverse,
backgroundColor: heatMapViridis,
format: TextRenderer.formatFixed({ digits: 2 }),
horizontalAlignment: 'right'
});
let grid1 = new DataGrid({ style: blueStripeStyle });
grid1.dataModel = model1;
grid1.keyHandler = new BasicKeyHandler();
grid1.mouseHandler = new BasicMouseHandler();
grid1.selectionModel = new BasicSelectionModel({ dataModel: model1 });
let grid2 = new DataGrid({ style: brownStripeStyle });
grid2.dataModel = model2;
grid2.keyHandler = new BasicKeyHandler();
grid2.mouseHandler = new BasicMouseHandler();
grid2.selectionModel = new BasicSelectionModel({
dataModel: model2,
selectionMode: 'column'
});
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid3.dataModel = model3;
grid3.keyHandler = new BasicKeyHandler();
grid3.mouseHandler = new BasicMouseHandler();
grid3.selectionModel = new BasicSelectionModel({ dataModel: model3 });
let grid4 = new DataGrid({ style: lightSelectionStyle });
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid3.dataModel = model3;
grid3.keyHandler = new BasicKeyHandler();
grid3.mouseHandler = new BasicMouseHandler();
grid3.selectionModel = new BasicSelectionModel({ dataModel: model3 });
let grid4 = new DataGrid({ style: lightSelectionStyle });
grid4.cellRenderers.update({ 'body': bgColorFloatRenderer });
grid4.dataModel = model4;
grid4.keyHandler = new BasicKeyHandler();
grid4.mouseHandler = new BasicMouseHandler();
grid4.selectionModel = new BasicSelectionModel({ dataModel: model4 });
let grid5 = new DataGrid({
style: greenStripeStyle,
defaultSizes: {
rowHeight: 32,
columnWidth: 128,
rowHeaderWidth: 64,
columnHeaderHeight: 32
}
});
grid5.dataModel = model5;
grid5.keyHandler = new BasicKeyHandler();
grid5.mouseHandler = new BasicMouseHandler();
grid5.selectionModel = new BasicSelectionModel({
dataModel: model5,
selectionMode: 'row'
});
let grid1 = new DataGrid({ style: blueStripeStyle });
grid1.dataModel = model1;
grid1.keyHandler = new BasicKeyHandler();
grid1.mouseHandler = new BasicMouseHandler();
grid1.selectionModel = new BasicSelectionModel({ dataModel: model1 });
let grid2 = new DataGrid({ style: brownStripeStyle });
grid2.dataModel = model2;
grid2.keyHandler = new BasicKeyHandler();
grid2.mouseHandler = new BasicMouseHandler();
grid2.selectionModel = new BasicSelectionModel({
dataModel: model2,
selectionMode: 'column'
});
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid3.dataModel = model3;
grid3.keyHandler = new BasicKeyHandler();
grid3.mouseHandler = new BasicMouseHandler();
grid3.selectionModel = new BasicSelectionModel({ dataModel: model3 });
let grid4 = new DataGrid({ style: lightSelectionStyle });
grid4.cellRenderers.update({ 'body': bgColorFloatRenderer });
grid4.dataModel = model4;
grid4.keyHandler = new BasicKeyHandler();
grid4.mouseHandler = new BasicMouseHandler();
grid4.selectionModel = new BasicSelectionModel({ dataModel: model4 });
let grid5 = new DataGrid({
style: greenStripeStyle,
defaultSizes: {
format: TextRenderer.formatFixed({ digits: 2 }),
horizontalAlignment: 'right'
});
let bgColorFloatRenderer = new TextRenderer({
textColor: heatMapViridisInverse,
backgroundColor: heatMapViridis,
format: TextRenderer.formatFixed({ digits: 2 }),
horizontalAlignment: 'right'
});
let grid1 = new DataGrid({ style: blueStripeStyle });
grid1.dataModel = model1;
grid1.keyHandler = new BasicKeyHandler();
grid1.mouseHandler = new BasicMouseHandler();
grid1.selectionModel = new BasicSelectionModel({ dataModel: model1 });
let grid2 = new DataGrid({ style: brownStripeStyle });
grid2.dataModel = model2;
grid2.keyHandler = new BasicKeyHandler();
grid2.mouseHandler = new BasicMouseHandler();
grid2.selectionModel = new BasicSelectionModel({
dataModel: model2,
selectionMode: 'column'
});
let grid3 = new DataGrid({ stretchLastColumn: true });
grid3.cellRenderers.update({ 'body': fgColorFloatRenderer });
grid3.dataModel = model3;
grid3.keyHandler = new BasicKeyHandler();
grid3.mouseHandler = new BasicMouseHandler();
grid3.selectionModel = new BasicSelectionModel({ dataModel: model3 });