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

An issue with the Grid Change event

5 Answers 585 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 06 Apr 2015, 06:10 PM

The grid change event doc states: "Fired when the user selects a table row or cell in the grid."

Is this absolute, or does this change if the grid is in editable mode?

Here is our issue. We have an grid using incell edit mode.

We bind to the change event:

$("#IncomeCodeMappingsGrid").on("change", "#IncCode", HandleIncomeCodeChange);

In the change event, we look for duplicate values in the data source by looping through all the datasource rows. Duplicate values are not allowed. 

This all works fine when using 2013.3.1324.440

However, after upgrading to 2013.3.1411.440 (which I think is SP1).

What happens in this case is that the value in the new row for the field in question is an empty string. 

However, this is only an issue in the columns where we use a kendoAutoComplete. 

I expect what might be happening is that the change is actually bubbled up from the auto complete. however, I have no way to check that, because per the docs I should be able to look at e.sender, but there is no sender on the event object passed to the handler.

So, yes, there are a few questions here.

1. When does the grid change fire, and is it different for an editable grid vs non-editable?

2. What was changed in SP1 that would be causing this so we can fix it. I assume something to changed in the autocomplete wrt to the change event.

3. How can I see what object fired the event? I think if I can ignore the change event bubbled up from the auto complete this will be able to work. 

(yes, I know we probably should be using the edit event but this method is used quite a bit in our code)

 

 

5 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 08 Apr 2015, 08:46 AM

Hello Bob,

The way you bind to the change event is not right. As explained in our documentation you need to use it as a config option and not using the jQuery event binder, as you will not bind to the grid change event. I would suggest you to follow our documentation example here:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-change

Regards,

Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bob
Top achievements
Rank 1
answered on 08 Apr 2015, 01:58 PM

Interesting. Why is it not possible to bind to the grid change event after configuration like it is for all the other events?

thanks.

 

0
Kiril Nikolov
Telerik team
answered on 09 Apr 2015, 10:01 AM

Hello Bob,

It is possible, here is how:

http://dojo.telerik.com/EYisi

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bob
Top achievements
Rank 1
answered on 09 Apr 2015, 02:28 PM

Ah, ok thanks. I figured that should work, but it wasn't documented like it was for all the other events.

When we wrote this page it was right when we started using your tools, so we weren't 100% sure how everything worked. We've gotten much better now. lol 

 

0
Kiril Nikolov
Telerik team
answered on 10 Apr 2015, 10:24 AM

Hello Bob,

Happy to help.

In case you have any further questions - please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Bob
Top achievements
Rank 1
Share this question
or