Telerik Forums
Kendo UI for jQuery Forum
1 answer
183 views
Hello,

I'm using Kendo UI MVC (the latest build as of 9/4/2013).
I have problems setting the XAxis lables to strings that represent dates in my database.
The Json that I feed to the chart has  MediaWeek as string date that is the XAxis label.
[
    {
        "Id": 1,
        "ClientCode": "JKLN",
        "ProductCode": "YYYY",
        "MediaWeek": "2012-12-31",
        "Spend": 3165,
        "Visits": 5704,
        "Orders": 422,
        "Revenue": 5774.29,
        "Cpv": 1.59,
        "Vpk": 717,
        "Mer": 0.92,
        "Conversion": 0.59
    },
....
]

The View looks like that:
        @(Html.Kendo().Chart<ContinuumData>()
              .Name("chart")
              .Legend(false)
              .HtmlAttributes(new {style = "height:235px;width:691px;"})
              .DataSource(ds => ds.Read(read => read.Action("Data_Read_Chart", "Continuum")))
              .Series(series => series.Bubble(
                  model => model.MediaWeek,
                  model => model.Revenue,
                  model => model.Mer,
                  model => model.ClientCode
                                    ))
              .XAxis(axis => axis
                                 .Date()
                                 .Labels(labels => labels
                                                        .Format("{0:MM/dd/yyyy}")))
              .YAxis(axis => axis
                                 .Numeric()
                                 .Labels(labels => labels
                                                       .Format("{0:N0}")
                                 )
                                 .Line(line => line
                                                   .Width(0)
                                 )
              )
              .Tooltip(tooltip => tooltip
                                      .Visible(true)
                                      .Format("{3}: {2:N0} MER")
                                      .Opacity(1)
              )
              .Theme("Moonlight")
              )

I also attached the screenshot of the chart with all bubbles clumped at 0 for the XAxis...

I could also change the type of the MediaWeek to DateTime if that helps....

If you guys could guide me I would be very grateful. 

Thanks,
-Arek
Hristo Germanov
Telerik team
 answered on 06 Sep 2013
15 answers
1.3K+ views
Hi. When looking at the basic example for the Scheduler (Scheduler basic usage), there is an example of how to apply a filter for the datasource. In my Scheduler, I'm binding the resources to a datasource, but when trying to apply the filter in javascript (like in the example for the main datasource filter), it is not working.
scheduler.resources.datasource.filter(filter);
Do anyone have an example for how to do this? Is it possible at all?
Alexander
Top achievements
Rank 1
 answered on 06 Sep 2013
1 answer
143 views
Hello,
I'm currently trying to develop a menu binding the data from the datasource.... I've folowed your example at http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/menu/overview

but I'm not able to load the children
@(Html.Kendo().Menu().Name("menu").BindTo(Model, mappings =>
    {
        mappings.For<IDEA20.DO.Common.MenuItem>(binding =>
            {
                binding.ItemDataBound((item, category) => //define mapping between menu item properties and the model properties
                            {
                                item.Text = category.Text;
                                 
                            }).Children(category => category.SubMenu);
            });
 
    })
     )
My MenuItem is of type

public class MenuItem
{
    public MenuItem()
    {
        SubMenu = new List<MenuItem>();
    }
 
    public string Text { get; set; }
    public string Controller { get; set; }           
    public string Action { get; set; }
    public bool Selected { get; set; }
 
    public List<MenuItem> SubMenu { get; private set; }
}
What am I doing wrong? It only shows the first, it puts the arrow for opening but won't open...

Thanks
Paolo

Georgi Krustev
Telerik team
 answered on 06 Sep 2013
1 answer
653 views
Hi - I would like to set the Max value on the valueAxis for two charts to the same value.  I want to use the max value found, and it won't always be the same or even on the same chart.  The charts sit side-by-side on my page and having the max be different can be misleading for our customers.  Attached is a screen shot showing what I mean.  In this case, I'd want the max to be either 43.36, or better yet rounded up to 50, for both charts, since that's the largest value I have.

Is there a way to do this?  I can of course hard-code a value, but we get quite a range depending on what the users pick to look at.

Thanks

Lisa
T. Tsonev
Telerik team
 answered on 06 Sep 2013
1 answer
119 views
Hi, Is there a way to implement listview with isotope to rpovide animation?

thanks
Nikolay Rusev
Telerik team
 answered on 06 Sep 2013
3 answers
138 views
I like how the Kendo Mobile listview remembers its place during page transitions...this is something that jQuery mobile does NOT have.  What's weird, however, is when I change the orientation, if I have scrolled down a little on the listview, it will return me to the top of the page.  I am on the flat UI.  Is there any way to fix this?
Kiril Nikolov
Telerik team
 answered on 06 Sep 2013
1 answer
516 views
So, we're evaluating Kendo UI against Dev Express for our next version of Oliver.  Thought I'd test forum support as well!  

I'm having a problem getting my tree view to display folders (rather than the default >).  Probably something simple.  Here's the MVC wrapper - note it's a treeview in a panel:

@(Html.Kendo().PanelBar()
    .Name("panelbar")
    .ExpandMode(PanelBarExpandMode.Single)
    .Items(panelbar =>
    {
        panelbar.Add().Text("Folders")
            .Content(@<text>
            <div id="folderTreeView">
                @(Html.Kendo().TreeView()
                    .Name("treeview")
                    .DataTextField("text")
                    .LoadOnDemand(true)
                    .DataSource(source => 
                        source.Read(read =>
                            read.Action("GetFolders", "documents")
                        )
                    )
                    .Events( events => events
                        .Select( "onTreeItemSelect" )
                    )
                    .Deferred()
                )
            </div>
            </text>);
        panelbar.Add().Text("Batches").Content("Batches? We 'aint got no batches. I don't gotta show you no stinkin' batches!");
        panelbar.Add().Text("Clusters");
        panelbar.Add().Text("Tags");
        panelbar.Add().Text("Exemplars");   

    })
    .Deferred()
)
 
Here's the ajax handler:
        public List<DocTreeItem> GetFolders(int? id)
        {
            if (!id.HasValue)
                id = 0;

            List<DocTreeItem> folders = (from docFolders in _dataContextFactory.OliverDBContext.GetTable<FolderTree>()
                                            where docFolders.ParentFolderId == id 
                                            select new DocTreeItem()
                                            {
                                                id = docFolders.FolderId,
                                                text = docFolders.FolderName + " (" + docFolders.DocCount.ToString() + ")",
                                                hasChildren = docFolders.HasChildren,
                                                spriteCssClasses ="folder"
                                            }).ToList();
            return folders;
        }

where DocTreeItem is:
    public class DocTreeItem
    {
        public int id { get; set; }
        public string text { get; set; }
        public bool hasChildren { get; set; }
        public string spriteCssClasses { get; set; }
    }

What am I doing wrong?  Note, I have to define DocTreeItem instead of using Kendo.TreeViewItem because of a problem with camelCase:  If I return a list of TreeViewItems, kendo js is expecting them in camel case.  But, when I enable camel case via: config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); my grid controls break because the grid model binds to the non-camel case model definition, but when it goes to bind on the client, the ajax call now is sending camel case and so the grid won't find it.  How do you deal with that, also?

Thanks,

Robert

Dimiter Madjarov
Telerik team
 answered on 06 Sep 2013
1 answer
48 views
Since $.Browser is deprecated and $.Support doesn't appear to provide a check for supported content types, what's the best way to deliver device specific content types?

Here are some valid examples;
Flash based content to desktop systems, alternate content to iPads. (Please no flames on Flash, it still has valid uses).

Ad-hoc iPad app installs where you would need an install link for iPad and a download link for other browsers.

This is what I'm currently using;

var agentMatch = navigator.userAgent.match(/(iPhone|iPod|iPad)/);
 window.is_AppleMobile = (typeof(agentMatch) === 'undefined') || (agentMatch === null)?false:true;

Any thoughts?

Kiril Nikolov
Telerik team
 answered on 06 Sep 2013
1 answer
112 views
Hello

I have script manager in my page and am using kendoGrid. I am connecting the grid to the service. When this code runs I get the following error:
SCRIPT5007: Unable to get property 'length' of undefined or null reference
ScriptResource.axd, line 5 character 5907
I've checked the script manager code it is with the endWith, (String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a})

Thank you for your help
Below is the script used
 
$(document).ready(function () { Sys.Application.add_load(initContactsPage); });
var contactsGrid = null;
function initContactsPage()
{
    var contactsColumns = [{
        field: "CustomerName",
        title: "Name",
        template: '<a class="name" href="ContactDetails.aspx?Id=#=CustomerID#">#=CustomerName#</a>'
    },
    {
        field: "strCustomerNumber",
        title: "Number"
    },
    {
        field: "strMainPhone",
        title: "Phone"
    },
    {
        field: "strCity",
        title: "City"
    },
    {
        field: "strWebsite",
        title: "Web Site"
    }
    ];
    contactsGrid = $("#gvContacts").kendoGrid({
        columns: contactsColumns,
        dataSource: new kendo.data.DataSource({
            pageSize: 10, serverPaging: true, page: 1,
            schema:
                {
                    total: "VirtualTotal",
                    data: "Records"
                },
            transport:
                {
                    read:
                    {
                        url: "/Services/APIService.asmx/ListObjectRecords",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        data: getData()
                    }
                },
            error: function (e)
            {
 
            }
        }),
        groupable: false,
        scrollable: false,
        pageable: true
    }).data("kendoGrid");
}
function searchContacts(page)
{
    contactsGrid.dataSource.page(1);
}
function getData()
{
    var contactsParams = {};
    contactsParams["objectId"] = "C9D9AEC9-F6C2-4EB3-8F00-D32A45A7C4C7";
    contactsParams["textFilter"] = null;
    contactsParams["sortColumn"] = null;
    contactsParams["startIndex"] = 1;
    contactsParams["pageSize"] = 10;
    return JSON.stringify(contactsParams);
}
Alexander Valchev
Telerik team
 answered on 06 Sep 2013
1 answer
148 views
The dataBound event can be wired up by data attribute but dataBinding cannot. Why?
<ul data-role="listview" data-bind="source: exampleData" data-binding="onDataBinding" data-bound="onDataBound"></ul>
<script type="text/javascript">
    function onDataBound (e) {
        console.log("this works");
    }
    function onDataBinding (e) {
        console.log("this doesn't");
    }
</script>
Alexander Valchev
Telerik team
 answered on 06 Sep 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
Map
Drag and Drop
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?