Seenu
#1
Hi
Mouse move over a element in dataview is working very slow.,
data.on_mouse_move[“my_imagex”] = function(e){
var id = this.locate(e);
var c=data.get(id);
if(c.State_imgid==1 || c.State_imgid==2 || c.State_imgid==3 ){
c.State_change_id=3;
}
data.refresh();
return true;
}
this is code for mouse move over a element with id my_imagex, when mouse is moved over a a new image is added before the image with id my_imagex…,
it is working fine but very slow…,please can u help me out
Change your code as
if(c.State_imgid==1 || c.State_imgid==2 || c.State_imgid==3 ){
c.State_change_id=3;
data.refresh(id);
}
a) data refresh will be called only if you are changing something in the data
b) instead of full repainting - only item in question will be repainted
Seenu
#3
Hi
I tried refreshing only one id…, but it is also working slow…
Thanks
Seenu
It repaints the only one item, which must be fast ( if you are using html template without inline frames or other complex structures )
Seenu
#5
hi…
im changing the html template on mouse over…, is there any other way to place a new image in the template
You can define a custom function as template, and in function, check some inner property of data object, and based on it render one or another image.
If you are changing template for whole dataview - it will repaint all dataview instead of the single item.