Completed
Last Updated: 08 Jul 2021 20:33 by ADMIN
Release 2019.R3
Mark Kedgley
Created on: 24 May 2019 09:05
Category: SPA
Type: Bug Report
0
Layout showIn method causes View show event to be raised twice

Taken from the StackOverflow question 'Why does 'show' event on Kendo View fire twice?' https://stackoverflow.com/questions/56266538/why-does-show-event-on-kendo-view-fire-twice

If a Kendo View is rendered into a Layout (using layout.showIn()), the show event for the view fires twice. Interestingly, if the view is rendered directly into a DOM element (using view.render()) the event is only fired once, like it's supposed to.

The code is pretty well copied from the Kendo UI Dojo thingee. I wonder if can you run this :https://dojo.telerik.com/AkOwiMAZ/2


<div id="app"></div>
<script>
var foo = new kendo.View("<span>Foo</span>", { hide: function() { console.log("Foo is hidden now"); }, show: function() { console.log( "Foo is shown now"); }});

var layout = new kendo.Layout("<header>Header</header><section id='content'></section><footer></footer>");

// Creating the layout, and using the showIn method to render the view
// is where I'm having the issue (2 'show' events fire)
layout.render($("#app"));
layout.showIn("#content", foo);
//
// But this way works fine (rendering directly to a DOM element) (just // one 'show' event fires)
//foo.render('#app');
</script>
The OP's dojo sample is set to run against the latest version of kendo; when running against the previous 2019 R1 SP1 (2019.1.220) the sample behaves as expected hence this appears to be a bug introduced in release 2019 R2 (2019.2.514)
3 comments
ADMIN
Veselin Tsvetanov
Posted on: 03 Jul 2019 07:57
Hello Mark,

Please, excuse us for misleading you with the Milestone sent on the bug fix. The fix is already available, however, it was not merged in our production branch before the SP release. It has been already merged now and the fix should be present in our latest internal build (that you could get from your Telerik account). Nevertheless, I would recommend you to avoid using that build for production, but only for testing purposes.

Once again, I beg your pardon for the misleading information and for the delay.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Mark Kedgley
Posted on: 26 Jun 2019 13:45

Hi,

According to the R2 2019 SP1 release notes, 'Show event of the View fires twice' is fixed. However, running the above sample against the latest 2019.2.619 assemblies it appears that the problem still persists.

Please can you confirm that this is still the case, and if possible when this might be fixed?

Thanks

ADMIN
Veselin Tsvetanov
Posted on: 27 May 2019 10:26
Hi Mark,

Thank you for that bug report. I have just included that in our backlog. Also, I have converted the current thread to a Bug report in our Feedback portal, so that you can track the bug status there: https://feedback.telerik.com/kendo-jquery-ui/1410447-layout-showin-method-causes-view-show-event-to-be-raised-twice

As a small token of gratitude for the reported bug, I have updated your Telerik points.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.