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

DataSource Change Event Not Firing

3 Answers 371 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 12 Jun 2014, 03:41 PM
Hello,
My understanding is  change event is fired on success of a service request. I have tried below code but no luck. The error event fires as expected.

Thanks for your time and help.

 function login() {
var username = $("#username").val();
var password = $("#password").val();
  
var dataSource = new kendo.data.DataSource({
   transport: {
       read: {
          
           url: "http://localhost:8080/NavXzy/rest/SecurityService",

           type: "POST",
           
           dataType: "json",

           data: { username: username, password : password }
           }
     },
 
   change: function (e) {
    console.log(e);
    },
  
   error: function(e) {
       console.log("error");
       e.preventDefault();
       app.navigate("kendoUI.html");
     }

});
 
dataSource.read();
}

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Jun 2014, 12:34 PM
Hello Hiren,

I have tried to reproduce the issue in a sample project, but to no avail. Please check it out and edit it so it can reproduce the issue that you are facing:

http://jsbin.com/giveyowo/1/edit

Thanks you in advance for your cooperation.

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
Hiren
Top achievements
Rank 1
answered on 13 Jun 2014, 02:58 PM
Thanks for your reply Kiril. 
The sample project works as expected but no luck with my application. The response from service call looks like below.
For now, I have continued with requestEnd event and based on the type (either read or undefined), I determine success or failure.

Please let me know if I am missing anything for changeEvent.

Thanks for your time and help.

--
Hiren


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Content-Length: 353
Date: Fri, 13 Jun 2014 14:53:32 GMT

{"userId":"36b2b9e0-7c96-4c2e-b99a-dd5fa228165d","timestamp":null,"activeFlag":1,"username":"hdossani","cellPhoneNumber":null,"officePhoneNumber":null,"isEnabled":null,"emailAddress":"hiren.dossani@foursource.ca","emailAlertIndicator":null,"dob":null,"userGoalSelections":[],"userRoles":null,"userPasswords":null,"userStars":null,"userConnections":null}
0
Kiril Nikolov
Telerik team
answered on 16 Jun 2014, 08:12 AM
Hi Hiren,

I am not able to see anything missing for the change event not to be fired. Would it be possible to put together a small runnable sample, where the issue is reproduced, so we can take a look?

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
Data Source
Asked by
Hiren
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Hiren
Top achievements
Rank 1
Share this question
or