Dear all,
i'm new to kendo ui and i'd tried the samples of scheduler
with the scheduler datasource along with AJAX and WCF
the sample source below
and WCF source below as
but it the data did not bind to the scheduler calendar and if i'm giving the data source without schema it works fine
and my output from wcf service below in attached image
please solve the above issue
thanks & regards
-santhosh
i'm new to kendo ui and i'd tried the samples of scheduler
with the scheduler datasource along with AJAX and WCF
the sample source below
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sheduler.aspx.cs" Inherits="WebApplication1.sheduler" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <link href="../../App_Global/styles/kendo.common.min.css" rel="stylesheet" /> <link href="../../App_Global/styles/kendo.default.min.css" rel="stylesheet" /> <script src="../../App_Global/js/jquery.min.js"></script> <script src="../../App_Global/js/kendo.all.min.js"></script> <script src="App_Global/js/kendo.web.min.js"></script> </head><body> <div></div> <div id="example" class="k-content"> <div id="scheduler"></div></div><script> var url = 'Service1.svc/'; var dataal; var dataSource1 = new kendo.data.SchedulerDataSource({ batch: true, data:dataal, transport: { read: function (options) { $.ajax({ url: url + "getsheduler", dataType: "json", async: false, cache:false, success: function (result) { options.success(JSON.parse(result.d)); }, error: function (result) { alert("error"); } }); } }, schema: { model: { id: "taskId", fields: { taskId: { from: "taskid", type: "number" }, title: { from: "taskname", defaultValue: "No title", validation: { required: true } }, start: { type: "date", from: "credate" }, end: { type: "date", from: "duedate" }, startTimezone: { from: "StartTimezone" }, endTimezone: { from: "EndTimezone" }, description: { from: "Description" }, recurrenceId: { from: "RecurrenceID" }, recurrenceRule: { from: "RecurrenceRule" }, recurrenceException: { from: "RecurrenceException" }, ownerId: { from: "projectid", defaultValue: 1 }, isAllDay: { type: "boolean", from: "IsAllDay" } } } } });
$(document).ready(function () { $("#scheduler").kendoScheduler({ date: new Date("2013/9/13"), startTime: new Date("2013/9/13 07:00 AM"), selectable: true, height: 600, views: [ "day", "week", { type: "month", selected: true }, ], timezone: "Etc/UTC", dataSource: dataSource1 }); });</script></body></html>using System;using System.Collections.Generic;using System.Linq;using System.Runtime.Serialization;using System.ServiceModel;using System.ServiceModel.Activation;using System.ServiceModel.Web;using System.Text;using Newtonsoft.Json;using System.Data.SqlClient;using System.Data;namespace WebApplication1{ [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class Service1 { String strConnString = "database=sample; server=URCI74;uid=sa;password=local"; [OperationContract] public void DoWork() { // Add your operation implementation here return; } // Add more operations here and mark them with [OperationContract] [OperationContract] [WebGet] public object getsheduler() { SqlConnection con = new SqlConnection(strConnString); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); adpt = new SqlDataAdapter("select projectid as ownerId, taskname as title ,credate as start,duedate [end],startTimezone,endTimezone,description,recurrenceId,recurrenceRule,recurrenceException,isAllDay from sheduler
", con); adpt.Fill(ds); return JsonConvert.SerializeObject(ds.Tables[0]); } }}
and my output from wcf service below in attached image
please solve the above issue
thanks & regards
-santhosh