Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Unified Diff: Source/devtools/front_end/ui/DataGrid.js

Issue 457283002: DevTools: DataGrid: optionally add className to cells. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/ui/DataGrid.js
diff --git a/Source/devtools/front_end/ui/DataGrid.js b/Source/devtools/front_end/ui/DataGrid.js
index a0f9561e26875180bdf3bfc929811324d4d37d1e..dd46bfb639ff6ec128565a944be0ce3d6a5d84a2 100644
--- a/Source/devtools/front_end/ui/DataGrid.js
+++ b/Source/devtools/front_end/ui/DataGrid.js
@@ -93,6 +93,9 @@ WebInspector.DataGrid = function(columnsArray, editCallback, deleteCallback, ref
/** @type {!Object.<string, !WebInspector.DataGrid.ColumnDescriptor>} */
this._columns = {};
+ /** @type {?string} */
+ this._cellClass = null;
+
for (var i = 0; i < columnsArray.length; ++i) {
var column = columnsArray[i];
var columnIdentifier = column.identifier = column.id || i;
@@ -177,6 +180,14 @@ WebInspector.DataGrid.Align = {
}
WebInspector.DataGrid.prototype = {
+ /**
+ * @param {string} cellClass
+ */
+ setCellClass: function(cellClass)
+ {
+ this._cellClass = cellClass;
+ },
+
_refreshHeader: function()
{
this._headerTableColumnGroup.removeChildren();
@@ -1311,6 +1322,10 @@ WebInspector.DataGridNode.prototype = {
{
var cell = document.createElement("td");
cell.className = columnIdentifier + "-column";
+ var cellClass = this.dataGrid._cellClass;
+ if (cellClass)
+ cell.classList.add(cellClass);
+
cell.columnIdentifier_ = columnIdentifier;
var alignment = this.dataGrid._columns[columnIdentifier].align;
« no previous file with comments | « Source/devtools/front_end/network/ResourceWebSocketFrameView.js ('k') | Source/devtools/front_end/webSocketFrameView.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698