Telerik Forums
Kendo UI for jQuery Forum
1 answer
254 views
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 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sheduler.aspx.cs" Inherits="WebApplication1.sheduler" %>
 
<!DOCTYPE html>
 
<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>
and WCF source below as

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]);
         
        }
    }
}

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
Rosen
Telerik team
 answered on 23 Sep 2013
7 answers
438 views
Hi,

We have an ASP.NET MVC 3 project in which we need to show a chart similar to the one below : 

http://demos.telerik.com/aspnet-mvc/razor/chart/multipleaxes

Except that

1> I don't need to stack columns above each other .
2> I want to show a table below the chart with values as in this example  - http://telerik.com/help/aspnet-ajax/chart-plot-area-data-table.html


Can you please help in finding out the correct property / setting for the kendo chart for requirement #2 ? 


Regards,
Sandeep.
Sandeep
Top achievements
Rank 1
 answered on 23 Sep 2013
1 answer
78 views
Hello,
I've got 2 questions.
I'm using Tabstrips and i would like to let the user adding and closing them dinamically. Of course adding is supported and well documented, but i couldn't find how to do it without workaround like the one reported here:
http://www.kendoui.com/forums/kendo-ui-web/tabstrip/issues-with-dynamically-openned-tabs-and-closing-it.aspx
Is there an official way to make the tabs closable? Like "closable: true"?

Thanks in advantage.
Dimo
Telerik team
 answered on 23 Sep 2013
1 answer
93 views
I am attempting to hit an ASP.NET MVC controller action with the Kendo Datasource from the "Autocomplete" widget. The controller looks a bit like this ..


public JsonResult Aspect(string term){
  // ...
}
So I need the actual URL parameter to be called "term" from the dataSource. So given this..

$(".autocomplete").kendoAutoComplete({
    dataTextField: "Name",
    dataSource: {
        type: "json",
        transport: {
            read: "/search/aspect",
            data: { term: $(this).val() }
        }
    }
});
I can't seem to get this to work though.

Also, it is important to note that there are MULTIPLE auto-completes on the page with dynamic identities. So it cannot work to call a specific selector.

I have been looking for a few hours, and I'm not seeming to find a way to do this.
Atanas Korchev
Telerik team
 answered on 23 Sep 2013
2 answers
702 views

Hi,

I've set up a Kendo Grid, and am customising the filter interface to show all values in a DropDownList. Through the DropDownList DataSource object I'm grouping on the field to be displayed (thereby removing any duplicates).

This works fine and shows exactly those values which should show, however on selecting a value I get an error in the kendo.all.js change function at the following line:

sourceValue = sourceItem.get(field);

The error being "Object doesn't support property or method 'get'"

Is this a bug in Kendo, or am I doing something wrong?!

For reference, the DropDownList is set up using the following code which is called from the filter UI function for each individual column (this applies to several columns). The filter function is there to filter the values based on all filters applied to the grid (i.e. so each filter only shows those values which are currently present in the grid according to applied filters):

function setFilter(url, element, field) {
    element.kendoDropDownList({
        dataSource: {
            transport: {
                read: {
                    url: url,
                    data: {
                        filter: function() {
     
                            var filters = $("#AccountsGrid").data("kendoGrid").dataSource.filter();       
                            var result = {};
 
                            if (filters) {
                                result.logic = filters.logic;
 
                                var filterArray = new Array();
 
                                for (var i = 0; i < filters.filters.length; i++) {
                                    filterArray.push({
                                        operator: filters.filters[i].operator,
                                        field: filters.filters[i].field,
                                        value: filters.filters[i].value
                                    });
                                }
 
                                result.filters = filterArray;
                            }
                            return JSON.stringify(result);
                        }
                    }
                }
            },
            group: {
                field: field
            },
            serverFiltering: true
        },
        dataValueField: "value",
        dataTextField: "value",
        optionLabel: "--Select Value--"
    });
}
Andrew
Top achievements
Rank 2
 answered on 23 Sep 2013
1 answer
388 views
I followed the tutorial, part 2 hello services. I wanted to extend the example and use it in a real world app that I am putting together. But I am having a issue. Here is my json data returned from my service:

[{"CustomerId":"60506","CustomerName":"WILLIAMS COMFORT AIR          ","PartNumber":"34.120.           ","Vnd":"PV","SellPrice":"       1.45","UM":"EA ","Branches":[{"Id":2,"AvailQty":0,"Status":"A","Location":"St. Louis"},{"Id":3,"AvailQty":100,"Status":"A","Location":"Paducah"},{"Id":4,"AvailQty":138,"Status":"A","Location":"Ft. Wayne"},{"Id":5,"AvailQty":685,"Status":"A","Location":"Indianapolis"},{"Id":6,"AvailQty":185,"Status":"A","Location":"Louisville"},{"Id":7,"AvailQty":132,"Status":"A","Location":"Lexington"},{"Id":8,"AvailQty":2,"Status":"A","Location":"Evansville"}]}]
Here is my js:
<script>
    var dataSource = null;
 
    $(function () {
 
    });
 
    function Lookup() {
        var customer = $("#customer").val();
         
        if (customer == "") {
            customer = "60506";
        }
 
        dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "api/part/",
                    data: {
                        partnumber: $("#part").val(),
                        customer: customer
                    }
                }
            }
        });
         
        dataSource.read();
 
        $("#partsGrid").kendoGrid({
            groupable: true,
            sortable: true,
            dataSource: {
                data: dataSource.data()[0].Branches,
                schema: "Branches"/*{
                    model: mySchema
                }*/
            }/*,
            columns: [{
                field: "CustomerId",
                title: "Id"
            }, {
                field : "CustomerName",
                title : "Name"
            }]*/
        });
    }
</script>
I want the datasource in an external var so I can ref other bit of information in it. In the end, I want a page with the customer name and customer id and the grid with each branch location and available quantity. Everything I've been reading suggest the datasource can not be a complex object. Is this true? What would be the best approach for me to take to get my results?

Thanks!
Daniel
Telerik team
 answered on 23 Sep 2013
2 answers
97 views
Hi 

I have bar charts and i am implementing drill downs in the chart. There are cases where there will be no data in the drill down  and at such times the screen will be blank with no indications. Is there a way to fix it?
Hari
Top achievements
Rank 1
 answered on 23 Sep 2013
13 answers
426 views
This:

<div id="splitter">

   <div id="left">Left pane</div>

   <div id="right"><iframe></iframe></div>

</div>



allows moving the splitter over the left, but gets lost when hovering over the iframe area.

How can you capture the mouse or set the z-index or whatever to capture the resize over the iframe.



[btw, it works if you are above or below the iframe part - just not over]

thx
Dimo
Telerik team
 answered on 23 Sep 2013
4 answers
242 views
Hello Dimo,
thanks for your reply, which allowed me a leap forward.
Now I understand that to get events from the kendo window in the code-behind I must append the window to the form and
why initially the window is outside.
I added appendTo("form#myform") as configuration option in the creation of the window.The window has a button.
Now I have only one window and I get the button click event in the code-behind.
I have a further question though:
1.
Still I think I'm confusing jquery appendTo and kendowindow appendTo.
The kendowindow appendTo(form) is a configuration option when I create the window. If I create the window without this option,
in the javascript button handler I will call always the jquery appendTo(form) which will always duplicate the window correct ?
So My only option then is to appendTo(form) when I create the window, correct ?

2.
Now the close doesn't give any error but I have the following situation:
Javascript handler
        <script language="javascript" type="text/javascript">
            $(document).ready(function () {
                $("#dialogLogout").kendoWindow({
                    draggable: true,
                    height: "300px",
                    modal: true,
                    resizable: false,
                    width: "600px",
                    actions: ["Minimize", "Maximize", "Close"],
                    appendTo: "form#form1"
                });
                var wnd = $("#dialogLogout").data("kendoWindow");
                $("#btnLogoutConfirmOK").bind("click", function () {
      //                    window.parent.$("#dialogLogout").data("kendoWindow").close();
                    //                    $("#dialogLogout").closest(".k-window-content").data("kendoWindow").close();
                    $("#dialogLogout").data("kendoWindow").close();
                });
            });
        </script> 
The code behind is something like this (I added a sleep of 5 seconds to simulate a long operation).
        protected void btnLogoutConfirmOK_Click(object sender, EventArgs e)
        {
             System.Threading.Thread.Sleep((int)System.TimeSpan.FromSeconds(5).TotalMilliseconds);
        }
The behavior seems
I click the button, the javascript handler is called,
The window closes, either of the 3 close statements give the same effect,
the server-side handler is called, waits for 5 seconds, it returns and forces the reopen of the window.
How can I close the window programmatically ?

Thank you for your kind attention,
best regards
Marco  
marco
Top achievements
Rank 1
 answered on 23 Sep 2013
2 answers
181 views
Hi guys, as per title, I have setup a simple demo menu from the examples and added a select event. This works in Firefox 24, Chrome 29 (29.0.1547.76), but the event does not fire in IE 11.0.9600 UNLESS you select Compatibility Mode, then all is fine.

Code:

<head>
    <title></title>
        <link rel="stylesheet" type="text/css" href="Content/Css/default.css" />
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <!-- Common Kendo UI Web CSS -->
        <link href="Content/Css/kendo.common.min.css" rel="stylesheet" />
        <!-- Default Kendo UI Web theme CSS -->
        <link href="Content/Css/kendo.default.min.css" rel="stylesheet" />
        <!-- Kendo UI Web combined JavaScript -->
        <script type="text/javascript" src="js/debug/kendo.web.js"></script>    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#menu").kendoMenu({
                select: function (e) {
                    // handle event
                    alert('clicked');
                }
            });
        });
    </script>
</head>
<body>
<ul id="menu">
    <li>Normal Item
        <ul>
            <li><span class="k-sprite icon-class"></span>Item with a Sprite</li>
            <li><img src="Icons/contacts.gif" />Item with an Icon</li>
        </ul>
    </li>
    <li><a href="http://www.google.com">Navigation Item</a></li>
    <li class="k-state-active">Active Item</li>
    <li>Template Item
        <div class="k-group k-content">
            Test button - <a class="k-button">Button</a>
        </div>
    </li>
</ul>
</body>

Any ideas please?


Simon

Simon
Top achievements
Rank 1
 answered on 23 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?