Telerik Forums
Kendo UI for jQuery Forum
1 answer
135 views
Am trying to use Linq (VB.net) to populate grid with data returning from MS SQL Stored procedure. 
1) Every thing works fine if SP returns fixed numbers of colums ex - 

Create procedure testp1 as 
begin 
select * from tab_a
end

2) How ever things dont work if SP returns dynamically created column names ex - 

Create procedure testp2 as 
begin
select 'T'+ltrim(str(day(getdate()-2),2)),'T'+ltrim(str(day(getdate()-1),2)),'T'+ltrim(str(day(getdate()),2))
end

Is there a way to populate data grid for SP like second one given above?
Petur Subev
Telerik team
 answered on 29 Jan 2014
1 answer
146 views
We use the Scheduler widget like the following: 

<div id="scheduler" style="height:500px"></div>
 
$("#scheduler").kendoScheduler({
    editable: {
        confirmation: false
    },
    resources: ko.observable([
        {
            field: "displayMode",
            dataSource: [
                    { text: "Regular-Other-Future", value: 111, color: "#93D095" },
                    ...
            ]
        }
    ]),
    add: function (e) {
        e.preventDefault();
        // Custom adding implementation
    },
    edit: function (e) {
        e.preventDefault();
        // Custom editing implementation
    },
    remove: function (e) {
        e.preventDefault();
        // Custom removing implementation
    },
    moveStart: function (e) {
        e.preventDefault(); // Prevent drag-and-drop
    },
    move: function (e) {
        e.preventDefault(); // Prevent drag-and-drop
    },
    moveEnd: function (e) {
        e.preventDefault(); // Prevent drag-and-drop
    },
    views: [{ type: "day", showWorkHours: true }, { type: "week", showWorkHours: true, selected: true }, "month", "agenda"],
    timezone: "Etc/UTC",
    date: new Date(),
    dataSource: self.dataSource // self.dataSource is KO observable, which is assigned later with kendo.data.SchedulerDataSource()
});

We need to have custom drag-and-drop handlers, but moveStart/move/moveEnd work unstable, sometimes it's impossible to drop the event (it sticks to mouse cursor) and exceptions are thrown from inside Kendo code after several D&D actions. We tried to block drag-and-drop operations (by calling preventDefault event methods, as you can see in the code above), but this does not help: if aggressively try to drag an event, exception appears again - but expected behavior is nothing should happen since the beginning of drag operation is prevented. 

The question is how to properly implement the moveStart/move/moveEnd handlers to have stable working in both cases (with custom logic and just to block the D&D feature)? 

Thank you very much in advance! 
Atanas Korchev
Telerik team
 answered on 29 Jan 2014
1 answer
214 views
I have a product where the users of the application are in different timezones and need to display scheduled entered by that user to other user's timezone.  I currently have the scheduler's timezone configured to "Etc/UTC".

The dates saved to the SQL database always equal the dates entered into the scheduler, regardless of the browser's or server's timezone.  It doesn't make sense to me if the incoming time is in UTC time or what???

How am I to convert the times to the appropriate timezone?  I do know what timezone the user is in, as it is part of the user's profile and its not dependent on the browser.


Thanks,
Chris
Atanas Korchev
Telerik team
 answered on 29 Jan 2014
3 answers
90 views
It seems Kendo UI does not support Waterfall chart. Is that right? 

Is there any trick to implement this kind of chart with the other available charts?

Thanks in advance.
Sebastian
Telerik team
 answered on 29 Jan 2014
2 answers
129 views
Hello,

the actionsheet isn't visible on ipad.
could you please check the sample if the code is wrong?

thank you
axel
axel
Top achievements
Rank 1
 answered on 28 Jan 2014
4 answers
106 views
I'm attempting to set the pageSizes property of the Pager widget via the data attribute "data-page-sizes". It works if I set it to a literal array, such as:
data-page-sizes="[15,30,60]"
But, it doesn't work if I try to set it to a javascript variable, such as:
data-page-sizes="myPageSizes"
How can I set this property to a javascript variable with the data attribute ?

Here's a js.bin example:  http://jsbin.com/aruTaWOZ/1/edit

Josh
Top achievements
Rank 1
 answered on 28 Jan 2014
1 answer
461 views
Is there a particular reason the Kendo UI validator does not support required radio button validation out of the box? Adding basic validation to the existing required rule seems relatively straightforward.

var radio = input.filter("[type=radio]");

if (radio.length) {
                //Ideally the search should be scoped to the element that validate was called on, but that would require several other changes
                return  $("input[name='" + input.attr("name") + "']").is(":checked"); 
            }

This would enable radio button validation, but would require all radio buttons in a group to specify the required attribute or the other radio buttons in the group would validate successfully, overriding the one that failed. A solution to the problem would be to do what jQuery validate does, which is to only validate the first element in an array of elements with the same name. Is there any downside to doing this? The only common uses for elements with the same name are checkboxes, radio buttons and buttons, and since buttons are already not validated, I don't see any downside.

Right now, without making the code changes specified above, I am relying on a custom rule that is incredibly inefficient since it has to continually get all radio buttons with the same name to see if any of them are decorated with a required attribute.

                    radiorequired: function (input) {
                        if (input.is("[type=radio]")) {
                            var radioButtons = $("input[name='" + input.attr("name") + "']");
                            if (!radioButtons.is("[data-val-required], required")) return true;

                            return radioButtons.is(":checked");
                        }

                        return true;
                    }

I guess my question is, why doesn't Kendo UI support required validation on radio buttons out of the box, and is there a better way to add the validation than what I am doing now?
Alexander Popov
Telerik team
 answered on 28 Jan 2014
7 answers
1.8K+ views
Hello KendoUI Team,

recently as I have discovered KendoUI and I was very impressed and really prefer over other frameworks like dojo, prototype!

Now, I have a small project which I a couple of issues with
  1. reading of the note.json file seems to be OK
  2. note.json contains 7 items but the paging shows "No items to display"
  3. the create, update and delete functions are working fine but there is no changes visible on the note.json file after a creation, deletion or update.
please find the whole file attached.

I have searched the KendoUI Forums including the web but could not find any help on this.

Please help create my first app with KendoUI!

Thanks
Omar
Richard
Top achievements
Rank 1
 answered on 28 Jan 2014
1 answer
273 views
Hi there,

Is there a simple or generic way to remove all menu items?

Regards,

Scott
Dimiter Madjarov
Telerik team
 answered on 28 Jan 2014
3 answers
381 views
I have problems having the scheduler widget initialize correctly.

When it shows up, I have to go forward one day and then backward one day to have it render as it should.

Why?

Because of problems with posting images on this forum, I had to create a stack overflow posting, if you are interested in screenshots of the rendition, look here.

The source code for index.html comes here (it is probably looking better on stack overflow):

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.web.js"></script>
    <script src="js/kendo.mobile.js"></script>
    
    <script>
        var app = new kendo.mobile.Application(document.body,
        {
            skin: 'flat'
        });
        
        window.kendoMobileApplication = app;
        
        $(function()
        {
            init_scheduler();
            change_view("#vHome");
        });

        function change_view(view)
        {
            app.navigate(view);
        }

        function init_scheduler()
        {
            $("#wScheduler").kendoScheduler({
                date: new Date("2013/6/13"),
                startTime: new Date("2013/6/13 07:00 AM"),
                height: 600,
                views: [
                        "day",
                        { type: "workWeek", selected: true },
                        "week",
                        "month",
                        "agenda"
                ],
                timezone: "Etc/UTC",
                dataSource: {
                    batch: true,
                    transport: {
                        read: {
                            url: "http://demos.kendoui.com/service/tasks",
                            dataType: "jsonp"
                        },
                        update: {
                            url: "http://demos.kendoui.com/service/tasks/update",
                            dataType: "jsonp"
                        },
                        create: {
                            url: "http://demos.kendoui.com/service/tasks/create",
                            dataType: "jsonp"
                        },
                        destroy: {
                            url: "http://demos.kendoui.com/service/tasks/destroy",
                            dataType: "jsonp"
                        },
                        parameterMap: function(options, operation)
                        {
                            if (operation !== "read" && options.models)
                            {
                                return { models: kendo.stringify(options.models) };
                            }
                        }
                    },
                    schema: {
                        model: {
                            id: "taskId",
                            fields: {
                                taskId: { from: "TaskID", type: "number" },
                                title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                                start: { type: "date", from: "Start" },
                                end: { type: "date", from: "End" },
                                startTimezone: { from: "StartTimezone" },
                                endTimezone: { from: "EndTimezone" },
                                description: { from: "Description" },
                                recurrenceId: { from: "RecurrenceID" },
                                recurrenceRule: { from: "RecurrenceRule" },
                                recurrenceException: { from: "RecurrenceException" },
                                ownerId: { from: "OwnerID", defaultValue: 1 },
                                isAllDay: { type: "boolean", from: "IsAllDay" }
                            }
                        }
                    },
                    filter: {
                        logic: "or",
                        filters: [
                                { field: "ownerId", operator: "eq", value: 1 },
                                { field: "ownerId", operator: "eq", value: 2 }
                        ]
                    }
                },
                resources: [
                        {
                            field: "ownerId",
                            title: "Owner",
                            dataSource: [
                                    { text: "Alex", value: 1, color: "#f8a398" },
                                    { text: "Bob", value: 2, color: "#51a0ed" },
                                    { text: "Charlie", value: 3, color: "#56ca85" }
                            ]
                        }
                ]
            });
        }

        function on_goto_scheduler_clicked()
        {
            change_view('#vCalendar');
        }
    </script>

    <link href="css/kendo.mobile.flat.css" rel="stylesheet" />
    <link href="css/kendo.common.css" rel="stylesheet" />
    <link href="css/kendo.default.css" rel="stylesheet" />
    <style>
        [href*=index], #back-button
        {
            visibility: hidden;
        }
    </style>
</head>
<body>
    <div data-role="view" id="vHome">
        <div class="margin-box">
            <span data-role="button" data-click="on_goto_scheduler_clicked">show scheduler</span>
        </div>
    </div>
    
    <div data-role="view" id="vCalendar">
        <div id="wScheduler"></div>
    </div>
</body>
</html>

Rosen
Telerik team
 answered on 28 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?