0

I's using SlickGrid, and want to add a css class to cells. But my column name includes a white space. Assuming the column name is 'Effort Driven', how can I refer this column?

grid.setCellCssStyles("key_highlight", {
    3: {
            finish: 'highlight', /* works fine */
            'effort driven': 'highlight' /*does NOT work*/
        }
 });

Thanks.

1 Answers1

0

If you are referencing it with bracket notation it should work,check out this page

have you tried accessing it like

key_highlight[3]['effort driven']

I'm still a little curious why you have a space in the key of a key value pair

Community
  • 1
  • 1
Nibb
  • 1,801
  • 1
  • 13
  • 19
  • 1
    I figure it out. The SlickGrid column definition has a id property. I should use column Id (effort-driven), rather than column name. var columns = [{ id: "effort-driven", name: "Effort Driven", field: "effortDriven" }, . . . ]; Thanks –  Sep 12 '15 at 22:50