TR Composite Grid and Cell Blinking
I am trying to implement the Cell Blinking feature on my Composite Grid.
My Composite Grid displays realtime data so I am using the example provided under EikonWebUI under Realtime Market Data. However, I want to implement the Cell Blinking feature that exists in the Core Grid. I checked the Core Grid Example and it shows a plugin called "CellBlinking" that is used. So I added the following to my grid:
var cbp = grid.getCoreGrid().loadPlugin("CellBlinking");
var blinker = cbp.getDefaultBlinker();
blinker.setBgColors("green", "red", "white"); // Up, down, no-change colors
blinker.setTextColors("black", "black", "black"); // Up, down, no-change colors
Is there any additional thing I should add? Because this is not working. I can't see any blinking cell although data is always changing.
My Composite Grid displays realtime data so I am using the example provided under EikonWebUI under Realtime Market Data. However, I want to implement the Cell Blinking feature that exists in the Core Grid. I checked the Core Grid Example and it shows a plugin called "CellBlinking" that is used. So I added the following to my grid:
var cbp = grid.getCoreGrid().loadPlugin("CellBlinking");
var blinker = cbp.getDefaultBlinker();
blinker.setBgColors("green", "red", "white"); // Up, down, no-change colors
blinker.setTextColors("black", "black", "black"); // Up, down, no-change colors
Is there any additional thing I should add? Because this is not working. I can't see any blinking cell although data is always changing.
Tagged:
0
Best Answer
-
Hi Taghrid,
Here's a quick solution. You can create a formatter that do the flashing and add to the formatter property of each column definition.
var realtimeFlasherFormatter = {
bind: function(rowIndex, columnIndex, value, cell, columnDef, dataRow, dataTable) {
if (value !== undefined && value !== null && value.raw !== null && value.raw !== undefined) {
if (cell.lastValue) {
var flashColor = null;
var fontColor = null;
if (rowIndex == cell.lastValue.rowIndex) {
if (cell.lastValue.value < value.raw) {
flashColor = "#39c46e";
fontColor = "white";
} else
if (cell.lastValue.value > value.raw) {
flashColor = "#f5475b";
fontColor = "white";
}
}
cell.setStyle("color", fontColor);
cell.setStyle("background-color", flashColor);
setTimeout(function() {
cell.setStyle("color", null);
cell.setStyle("background-color", null);
}, 200);
} else {
cell.lastValue = {
rowIndex: rowIndex,
value: value.raw
}
}
cell.lastValue.rowIndex = rowIndex;
cell.lastValue.value = value.raw;
} else {
cell.setStyle("color", null);
cell.setStyle("background-color", null);
}
}
}
In you column definition, you can pass in this formatter for example
{id: "c7", title: "Pct.Change", field: "PCTCHNG", sortBy: "PCTCHNG", formatter: [realtimeDataFormatter, realtimeFlasher]}
Formatter can be passed as array and please refer to realtimeDataFormatter in the Realtime Market Data sample of CompositeGrid in Eikon Web UI1
Answers
-
This formatter is useful so I'll add it together with the TR-Grid in the next release so people can just use it as a built-in formatter.0
-
Thank you Panit. Worked like a charm!0
-
Taghrid, This is a better approach. I created this as a reusable class. [
http://plnkr.co/edit/uQWyjgcQV3UqPIXjLHsG?p=preview](http://plnkr.co/edit/uQWyjgcQV3UqPIXjLHsG?p=preview) I created this hub page for storing the collection of formatter for people to reuse [
https://thehub.thomsonreuters.com/docs/DOC-999357](https://thehub.thomsonreuters.com/docs/DOC-999357)1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛