Surface click function fires two times - Forum - Kendo UI Builder - Progress Community

Surface click function fires two times

 Forum

Surface click function fires two times

This question is answered

Hello together,

I have a surface with 1 to 8 rectangles in a listview. If the user clicks on a rectangle the color is changing and I'm executing an invoke function in the ABL Business Logic for booking goods receipts.

Does anyone have the same problem, that the invoke function is executing two times?

In Kendo the surface object gots two click events when I'm adding my function for the click event.

I also checked this with the surface API example in the Dojo and there is only one click event.

Does anyone have an idea what I'm doing wrong? 

Here is a part of my function to create the surface.

rectGeometry1 = new geom.Rect(["0em", "0em"], ["10em", "9em"]);
rect1         = new draw.Rect(rectGeometry1);
rect1.stroke("black", 1);
rect1.fill("white", 1);

rectGeometry2 = new geom.Rect(["11em", "0em"], ["10em", "9em"]);
rect2         = new draw.Rect(rectGeometry2);
rect2.stroke("black", 1);
rect2.fill("white", 1);

rectGeometry3 = new geom.Rect(["0em", "10em"], ["10em", "9em"]);
rect3         = new draw.Rect(rectGeometry3);
rect3.stroke("black", 1);
rect3.fill("white", 1);

rectGeometry4 = new geom.Rect(["11em", "10em"], ["10em", "9em"]);
rect4         = new draw.Rect(rectGeometry4);
rect4.stroke("black", 1);
rect4.fill("white", 1);

surface = draw.Surface.create($("#surface"), {
	click: onClickOnSurface
});

surfaceData                      = $("#surface").data("kendoSurface");
surfaceData.element.childrens    = [];
surfaceData.element.childrens[0] = rect1;
surfaceData.element.childrens[1] = rect2;
surfaceData.element.childrens[2] = rect3;
surfaceData.element.childrens[3] = rect4;

surface.draw(rect1);
surface.draw(rect2);
surface.draw(rect3);
surface.draw(rect4);

function onClickOnSurface(e) {

	e.element.fill("blue", 1);
	// Invoke function

}
Verified Answer
  • Hi,

    I reproduced the problem on my side and in dojo with older version of kendo:

    http://dojo.telerik.com/Ixere/2

    It seems that the problem is fixed in the newest version of kendo. Unfortunately, in the current version of kuib builder we do not have functionality for changing dependency library version. If you change the kendo version it will be overridden when you re-generate the app.

    The good news is that for the next release we will implement such functionality and developers can override the versions of the libriries.

     

    Best,

    Rado

All Replies
  • Hi,

    I reproduced the problem on my side and in dojo with older version of kendo:

    http://dojo.telerik.com/Ixere/2

    It seems that the problem is fixed in the newest version of kendo. Unfortunately, in the current version of kuib builder we do not have functionality for changing dependency library version. If you change the kendo version it will be overridden when you re-generate the app.

    The good news is that for the next release we will implement such functionality and developers can override the versions of the libriries.

     

    Best,

    Rado

  • Hi Rado,

    thanks for the answer.

    Good to hear that such functionality will be implemented. When then next release is planed?

  • Hi,

    The next version will be available at the end of this month (or at the beginning of the next – since we need to be sure that everything is with the best quality like always).

    Best,

    Rado

  • Sounds good, thanks a lot!