dhtmlxGrid +AddRow +alt +javascript

I am attempting to add a row with a javascript “onClick” event and an alt tag for the image.



I found this answer on your site but could not make it work for me. I’m obviously doing something wrong… I just cannot figure out what.

dhtmlx.com/docs/products/kb/ … 0img%20alt



This line works

grdFavorites.addRow(iIndex," · “+sRestaurant+”,images/Favorite_Order.jpg");





This line does not. I have tried several variants on this but with no luck

grdFavorites.addRow(iIndex," · “+sRestaurant+”,");

grdFavorites.addRow(iIndex," · “+sRestaurant+”,"); //single quote





Thanks for any help.

James


Try to do the following:


grdFavorites.addRow(iIndex,[" � “+sRestaurant,”"]);


Second parameter of addRow method - array of row’s values: [“value for the first cell”,“value fo the second cell”,""]


Thanks for the help.  There was a small issue with where the quote started



The answer was posted as:
grdFavorites.addRow(iIndex,[" � “+sRestaurant,”"]);



This is the correct one
grdFavorites.addRow((iRow +1),[" · “+sRestaurant+”,"]);



What was missing was the +",  after sRestaurant.  The quote was after the comma instead of before it.   Thank you again for the help!!