SmartRendering and Events on load

Hi,

I have a grid which can host a huge amount of data.
These data are built in a PHP file, and the result is parsed using : myGrid.parse(dataSet,"json")

In order to have a better display time, I use two things :

myGrid.enableSmartRendering(true);

and

$(myGrid.entBox).hide(); myGrid.parse(dataSet,"json") $(myGrid.entBox).show();

After the parse event ended, I set up some jQuery event using a $(.) selector to target all in the grid as follow :

$(".myClass).hover(function(){...});

The problem is, even if the hover function on the elements displayed work perfectly, it is not called on those not yet displayed.
I figured it’s because they are not yet loaded, thanks to the “smartRendering” option.

My question is this one : is there an event called when rows are loaded via smartRendering ? I should then be able to unbind/bind the event normally.

I found a solution, which is more like a “hack” than a real long-terme solution :

[code]
//Temporary function linking jQuery events to dhxGrid rows
var linkRows = function(){
if(tmpRowsLinked.length<2){return;}
var tmpRowToLink = tmpRowsLinked[0];
$("#"+tmpRowToLink).click(function(){…});
tmpRowsLinked.shift();
};

var tmpRowsLinked = [];
tmpGrille.attachEvent(“onRowCreated”,
function(pRow){
tmpRowsLinked.push(pRow);
linkRows();
if(pRow==“lastRow”){tmpGrille.setRowHidden(“lastRow”,true);}
}
);

tmpGrille.parse(dataFromScrip,“json”);[/code]

You just have to make sure to add a row identified as “lastRow” at the end of your dataSet