Enable Row Hover Using Object Notation

When enabling row hovering using object notation to initialize a grid, how do you correctly pass in the class name?

The API says the hover option is expecting a {string}. I’ve tried:

var grid = new dhtmlXGridObject({
  hover: "true, hover-class"

var grid = new dhtmlXGridObject({
  hover: "true, 'hover-class'"

var grid = new dhtmlXGridObject({
  hover: {mode: true, cssClass: "hover-class"}


Rows hover on mouse over can be specified and enabled for rows in the grid through the following method:

    grid.enableRowsHover(mode, cssClass);

The parameters here are:

mode(true|false) - enable|disable rows hover;
cssClass - css class for hovering a row.

docs.dhtmlx.com/doku.php?id=dhtm … erowshover

Victor Johnson

Thank you. So, is object notation not supported if a hover class needs to be specified?

Please see the hover option in the docs below:
docs.dhtmlx.com/doku.php?id=dhtm … tor_object

Yes. Kindly note that for each and every option they specify a method.

In your case
hover - {string} enable/disable hovering
row on mouse over

Victor Johnson

Thanks. However, notice that the hover option is expecting a {string} value not just a boolean. Is it possible to pass in a formatted string, containing true/false and a class name, instead of using the method? (Please see my first post for examples I’ve tried).

Unfortunately such feature is not supported.

Your responses are not clear.

On docs.dhtmlx.com/doku.php?id=dhtm … tor_object
it says one of the properties I can specify is “hover” which takes a string.
The problem is the enableRowsHover() takes two arguments - mode and cssClass.
What do I need to specify in the constructor object to mimic how I use the enableRowsHover() function?
I tried hover:‘mycssclass’ and then hover:{mode:true,cssClass:‘mycssclass’} and they had no effect.

What do I specify if I want to use hover in my constructor?