Telerik Forums
Kendo UI for jQuery Forum
1 answer
228 views
Hello Guys.

Im trying to use the Kendo Date Picker (Not DateTimePicker)

I use it in ASP.Net MVC 4 with Razor 2. In my Model it looks like this :

[Required(ErrorMessageResourceName = "GeburtstagFehlt", ErrorMessageResourceType = typeof(Resources.Shared.ValidationMessages))]
       [Display(Name = "Geburtstag", ResourceType = typeof(Resources.Models.Kontakt))]
       [DataType(DataType.Date, ErrorMessageResourceName = "GeburtstagUngueltig", ErrorMessageResourceType = typeof(Resources.Shared.ValidationMessages))]
       public DateTime Geburtstag { get; set; }
In View:
@model DateTime?
 
@(Html.Kendo().DatePickerFor(m => m))


When i post the Form it show a Validation Failure but the Date is valid.

I am use the swiss/german format dd.MM.yyyy  i am gone to be crazy. Since 4 Hourse i am trying it to fixt this -_-''

So please help me.
Daniel
Telerik team
 answered on 08 May 2013
2 answers
328 views
Hello,

I'm using server side aggregation. It works perfectly when reading data. But if an item is destroyed or updated the aggregate is not recalculated (my update/destroy response contains "aggregates" data). 

For this reason, I need another request to server to read data again - which is not a case in our business application. Is this a known issue? Or maybe there is a workaround for that?

Thanks.

My datasource declaration:

viewModel = kendo.observable({
        gridSource: new kendo.data.DataSource({
            serverAggregates: true,
            transport: {
                read: function(options) {
                    $.ajax({
                        url: "/ajax/getProducts",
                        type: "GET",
                        cache: false,
                        dataType: "json",
                        success: function(result) {
                            options.success(result);
                        }
                    });
                },
                destroy: function (options) {
                    var id = {id: options.data.id};
                    $.ajax({
                        url: "/ajax/deleteProduct",
                        cache: false,
                        type: "DELETE",
                        contentType: "application/json",
                        data: JSON.stringify(id),
 
                        success: function(result) {
                            options.success(result);
                        },
                        error: function(result) {
                            options.error(result);
                            viewModel.gridSource.cancelChanges();
                        }
                    });
                },
 
                update: function (options) {
                    $.ajax({
                        url: "/ajax/updateItem",
                        cache: false,
                        type: "POST",
                        contentType: "application/json",
                        data: JSON.stringify(options.data),
 
                        success: function(result) {
                            options.success(result);
                        },
                        error: function(result) {
                            options.error(result);
                        }
                    });
                }
            },
            schema: {
                data: "data",
                aggregates: "aggregates",
                model: {
                    id: "id",
                    fields: {
                        id: {
                            type: "string"
                        },
                        description: {
                            type: "string"
                        },
                        price: {
                            type: "number"
                        },
                        quantity: {
                            type: "number"
                        }
                    }
                }
            },
            aggregate: [
                { field: "totalPrice", aggregate: "sum" }
            ]
        })
});

My destroy action json response:

{"totalSize":null,"data":[],"aggregates":{"totalPrice":{"sum":51.1}}}

Thank you!


Aurimas
Top achievements
Rank 1
 answered on 08 May 2013
1 answer
173 views
Hi,

I use the Template Grid Column in a lot of places throughout my app to link to related objects. For example, Contacts can be directly linked to an Account, therefore I allow users to navigate to the Account via the Account Name link in the Grid. 
.Columns(columns =>
        {
            columns.Template(c => c.ContactID)
                .ClientTemplate("<a href=\"/Contacts/Details/#=ContactID#\">#=Name#</a>")
                .Title("Name");
            columns.Template(c => c.Account.AccountName)
                .ClientTemplate("<a href=\"/Accounts/Details/#=AccountID#\">#=Account.AccountName#</a>")
                .Title("Account");
        })
Since both columns have an underlying field that is bound (ContactID & AccountID), is there a way to group/filter on these columns like you would on a regular "Bound" field? 

Thanks,
Landon

Petur Subev
Telerik team
 answered on 08 May 2013
3 answers
263 views
I build a menu using a data source to supply the items.  The data source is just an array of objects that have text, url, and items properties (for sub menus)

Subsequently, i want to select some menu item and apply some API function to it, like say enable.
To do so, I need to first find the particular menu item of interest.  It would be nice if the menu item had an ID property. Its easy enough to add that property to my data source, but it doesn't carry through when the menu is rendered.

And, it is pretty easy to see the change that i would like to make to the menu's item template. Just add something like this:
     #= item.id ? 'id=\"'+item.id+'\"' : '' # 
to the item member of the templates object in kendo.menu.js

Problem is, the templates object is a function scoped "private" variable and I can't really see any good way to override or augment Menu to achieve this.

Any suggestions?

Thanks 
roger
Kamen Bundev
Telerik team
 answered on 08 May 2013
1 answer
155 views

Hi,

I've got a snipplet of C# razor syntax below which builds up columns for a 12 month period.

The Month1-12 fields can be null.
I would like to be able to sort on Month<number>.EHR.

For example I want to sort on month 'Month12.EHR'.
Because Month12 is null, the grid continuously looks like it's loading.

How am I able to sort the grid on columns that have null?

@for (int i = 12; i > 0; i--)
{
    <text>
    {
        field: 'Month@(i).EHR',
        title: 'Month@(i)',
        template: '#if (Month@(i) != null) {#$#:Month@(i).EHR#.00 (#:Month@(i).TotalTime#)#} else {# #:"--"# #} #',
        width: 20
    },
    </text>
}

Thanks, Mike.
Daniel
Telerik team
 answered on 08 May 2013
2 answers
65 views
Hello!
I'm trying to figure how http://demos.kendoui.com/web/datasource/shared-datasource.html works.
I copied code to my project, provided full url to transport object:
                    read: {
                        url: "http://demos.kendoui.com/content/web/datasource/internet-users.json",
                        dataType: "json"
                    }
                };

Problem is that chart and grid are empty (see UIScreenShot.png).  
What could be wrong here?
Thanks!

Kendo UI version:13.1.320
OS: win2008
exact browser version: FF 20.0.1
Olga
Top achievements
Rank 1
 answered on 07 May 2013
2 answers
195 views
Hi Kendo Team,
I received a funny behaviour of KendoChat (please refer to the attachment) . Need help in what i have done wrong? I am using asp.net 3.5 framework and below are my code:

KendoUI.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Services;
 
 
public partial class KendoUI : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
         
    }
 
     [WebMethod]
    public static string GetJson()
    {
       System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
                Dictionary<string, object> row;
   
                for (int i = 0; i <= 5; i++) {
                    row = new Dictionary<string, object>();
 
                        row.Add("country", "Singapore");
                        row.Add("year", (2000 + i).ToString() );
                        row.Add("value", 50 + i);
                     
                    rows.Add(row);
 
                }
                return serializer.Serialize(rows);
 
  
 
    }
}

KendoUI.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KendoUI.aspx.cs" Inherits="KendoUI" %>
 
 
<!doctype html >
<html>
<head runat="server">
    <link href="KendoCSS/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
 
 <script src="KendoJs/jquery.min.js" type="text/javascript"></script>
<script src="KendoJs/kendo.dataviz.min.js" type="text/javascript"></script>
<script src="KendoJs/kendo.data.min.js" type="text/javascript"></script>
 
 
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <div class="chart-wrapper">
        <div id="chart" ></div>
        <div id="test" />
    </div>       
    </div>
    </form>
</body>
 
  
    <script>
        $(document).ready(function () {
        
            $.ajax({
                type: "POST",
                url: "KendoUI.aspx/GetJson",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
 
                    if (data != "") {
                  
                        $("#test").html(internetUsers);
 
                        $("#chart").kendoChart({
                            theme: $(document).data("kendoSkin") || "default",
                            dataSource: {
                                data: internetUsers
                            },
                            title: {
                                text: "Internet Users"
                            },
                            legend: {
                                position: "bottom"
                            },
                            seriesDefaults: {
                                type: "line",
                                labels: {
                                    visible: true,
                                    format: "{0}%"
                                }
                            },
                            series: [{
                                field: "value",
                                name: "Singapore"
                            }],
                            valueAxis: {
                                labels: {
                                    format: "{0}%"
                                }
                            },
                            categoryAxis: {
                                field: "year"
                            }
                        });
                    }
 
                }
 
            })
 
 
        });
            </script>
</html>            
Michael
Top achievements
Rank 1
 answered on 07 May 2013
1 answer
294 views
I have an Alert DataSource i have a listview bound to.
Alerts many to many with Tags
I need a way to filter using the any operator.  Is this supported in: DataSourceRequest?

how would i define the json if supported or is there a workaround?
{
     "field": "Tags",
                    "operator": "eq",
                   "value": 'Marketing'
}



related:
http://stackoverflow.com/questions/9278044/wcf-data-services-many-to-many-with-filter
leblanc
Top achievements
Rank 1
 answered on 07 May 2013
2 answers
188 views
Hi,
Is there any reason why this file needs to have an @ symbol in it?
It causes a problem when trying to deploy in a SharePoint app. SharePoint doesn't like files with an @ symbol in it.
Many thanks
Toby
Top achievements
Rank 1
 answered on 07 May 2013
2 answers
69 views
Hi,

How do you open the timepicker in the datetimepicker using the keyboard?

According to the following link:
http://demos.kendoui.com/web/datetimepicker/navigation.html

you can open the date picker using alt+down arrow, but how do you access the timepicker component of the datetimepicker using the keyboard?

Thanks
Dimo
Telerik team
 answered on 07 May 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Drag and Drop
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?