Skip to content

Commit 115efc7

Browse files
committed
feat(slick_grid): add color and backgroundColor options to action columns
1 parent c467b1d commit 115efc7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/modules/types/edition/slick_grid/controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ define(['modules/default/defaultcontroller', 'src/util/util', 'lodash', 'src/uti
220220
type: 'text',
221221
title: 'Icon'
222222
},
223+
backgroundColor: {
224+
type: 'spectrum',
225+
title: 'Background Color',
226+
default: [255, 255, 255, 1]
227+
},
228+
color: {
229+
type: 'spectrum',
230+
title: 'Color',
231+
default: [0,0,0,1]
232+
},
223233
action: {
224234
type: 'text',
225235
title: 'Action to send'

src/modules/types/edition/slick_grid/view.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,9 @@ define([
704704
icon: colDef.colDef.icon,
705705
disabled: false,
706706
action: colDef.colDef.action,
707-
tooltip: colDef.colDef.tooltip
707+
tooltip: colDef.colDef.tooltip,
708+
backgroundColor: colDef.colDef.backgroundColor,
709+
color: colDef.colDef.color
708710
}
709711
};
710712

@@ -720,7 +722,12 @@ define([
720722
}
721723
}
722724

725+
723726
var $cellNode = $(cellNode);
727+
728+
$cellNode.css('backgroundColor', context.renderOptions.backgroundColor);
729+
$cellNode.find('a').css('color', context.renderOptions.color);
730+
724731
var $a = $cellNode.find('a');
725732
$a.attr('title', context.renderOptions.tooltip);
726733

0 commit comments

Comments
 (0)