From 83424cba484806e6584eec528c09c638bd3074b6 Mon Sep 17 00:00:00 2001 From: Rodelle Ladia Date: Tue, 10 Jan 2017 13:47:20 -0800 Subject: [PATCH] Add optional style to column The allows inline react styles to be applied to all td elements in the column. --- rjt.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rjt.js b/rjt.js index a85ea68..4d184ee 100644 --- a/rjt.js +++ b/rjt.js @@ -117,10 +117,12 @@ var JsonTable = React.createClass({ // This is about get default column definition // we use label as key if not defined // we use key as label if not defined + // we use empty style as style if not defined // we use getItemField as cell function if not defined return { key: key, label: col.label || key, + style: col.style || {}, cell: col.cell || getItemField }; } @@ -193,6 +195,7 @@ var Row = React.createClass({ return $.td( { className: className, + style: col.style, key: key, "data-key": key, onClick: me.onClickCell