This is a migrated thread and some comments may be shown as answers.

values returned from event handlers

2 Answers 85 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Dr.YSG
Top achievements
Rank 2
Dr.YSG asked on 18 Apr 2012, 05:39 PM
I have a change event hander for my datasource

change: function (e) {
    newData(e);
}

Right now, if the newData exits normally, without hitting the return statement, then all works fine. But if i uncomment the last line in the listing below (which returns nothing) then the datasource is not updated in the Grid that is mapping it. I have tried returning true, false, this and e, but nothing works:

What is an event handler supposed to return (documentation needs to be filled, as well as what the value of e is supposed to be).

btw searchData below is that handle for the datasource

function newData(e) {
    $("#recCount").text(searchData.total());
 
    chartData.series = [];
    chartData.names = [];
    var groups = searchData.view();
    var groupCnt = groups.length;
    var group;
//    if (groupCnt == seachData.total()) return; // nothing grouped, no meaningful chart can be created.

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 23 Apr 2012, 09:41 AM
Hi,

I'm afraid that the provided information is not sufficient in order to track the cause for the described behavior. Therefore, you should provide a jsFiddle page in which this issue can be observed locally. Also note that event handlers does not need to return anything.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dr.YSG
Top achievements
Rank 2
answered on 23 Apr 2012, 08:31 PM
I'm sorry. I am only able to reproduce this error with remote data. And that remote data cannot be exposed in a JsFiddle. When I tried it with local data I did not have the problem.

By restructuring my code so that I did not have to have an explicit "return" in the change  event handler, I no longer have this problem.

So I guess we have to close this thread. But thank you for your attention to this matter. I appreciate it.

Tags
Data Source
Asked by
Dr.YSG
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Dr.YSG
Top achievements
Rank 2
Share this question
or