This is a migrated thread and some comments may be shown as answers.
OnChange called twice
1 Answer 28 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gabe Knight
Top achievements
Rank 1
Gabe Knight asked on 05 Oct 2010, 07:29 AM
Hi,
I know this somehow seems to have an easy solution but right now I'm stuck, so I need your help.
I have attached a handler to my calendar control where I do an ajax request by using the following snippet:

<% Html.Telerik().DatePicker()
  .Name("date")
  .Value(Model.DateTime.Today)
  .ClientEvents(events => events
  .OnChange(() =>
  {
        %>
        function(e) {
               $.post("/SingleUpdate", {
                                        propertyName: propertyName,
                             newValue: newValue
                            },
 
                           function(message) {
                            singleUpdateCallback(message);
                      });        
        <%
  }))
.ShowButton(true).Render(); %>
The request calls SingleUpdate action method where I use Reflection, the propertyName and the new value to update a value in my business object. Action method works fine but it is executed twice. I know that this has something to do with event propagation but I have no lead to follow. Note that the request is executed twice even when I click outside the datepicker or press the tab key or the enter key.
Thanks in advance,

Dimitris

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 05 Oct 2010, 10:00 AM
Hello Gabe Knight,

Depending on the given information it is hard to determine where could be the problem. I will suggest you check this online demo which is devoted on the client-events of the datepicker UI component.

If the problem still persists you can send us a simple test project which reproduces the depicted issue.

Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Calendar
Asked by
Gabe Knight
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or