Telerik Forums
Kendo UI for jQuery Forum
1 answer
72 views
I have a line chart that displays some data, this data is collected on a daily basis, so currently I have a chart point for each day. That works fine, however as this data increases I will have some  data sets with many weeks or months worth of data, where as others will only have a few days worth.

What I would like to do is have the chart deal with this dynamically, so if I have, say, over 4 weeks of data, then it should only plot a point for each week (and make this an average of the daily data for that week). If it is less than 4 weeks, plot a point for each day.

Is there an easy way to do this with the charting component, rather than having to pre -process the data before it gets there?

I am using the MVC wrapper.
T. Tsonev
Telerik team
 answered on 28 Mar 2013
1 answer
342 views
I would like to implement server paging so I retrieve a subset of data (50 records) from the server a put it into an observable array called self.grdTableData. I then create a Kendo DataSource as follows:

                  var grdTableResults = $("#grdTableResults").data("kendoGrid");

                    var ds = new kendo.data.DataSource({                      
                        data: self.grdTableData, //observableArray
                        serverPaging: true,
                        pageSize: 50,
                        total: joOutput["TotalRecords"], // total count of all data retrieved from table
                        schema: {
                            data: "data",
                            total: "total"
                        }
                    });

                    grdTableResults.setDataSource(ds);

However, when I set the data source, my grid contains the first page of data, but has a rotating stream of circles like it is waiting for something to finish. Further investigating revealed that there was actually an "Uncaught TypeError: cannot read property length of undefined" which pointed to line 4690 of kendo.web.js v2012.3.1114. So I'm wondering what the the value "array" is (any why it's undefined) in this instance with reference to how my data source is being constructed and what, if anything, I'm missing, or misconfiguring while I'm creating the data source so that I can use server paging. Any comments, suggestions, or insights on this are greatly appreciated. Thanks!



Petur Subev
Telerik team
 answered on 28 Mar 2013
1 answer
176 views
I having a problem with the cascade combobox.  Here is the code with the json file.  I get undefined in the dropdown lists

            <div class="demo-section">
                <h2>View Order Details</h2>
                <p>
                    <label for="categories">Categories:</label><input id="categories" style="width: 300px" />
                </p>
                <p>
                    <label for="products">Products:</label><input id="products" disabled="disabled" style="width: 300px" />
                </p>
                <p>
                    <label for="orders">Orders:</label><input id="orders" disabled="disabled" style="width: 300px" />
                </p>

                <button class="k-button" id="get">View Order</button>
            </div>

            <style scoped>
                .demo-section {
                    width: 460px;
                    padding: 30px;
                }
                .demo-section h2 {
                    text-transform: uppercase;
                    font-size: 1.2em;
                    margin-bottom: 30px;
                }
                .demo-section label {
                    display: inline-block;
                    width: 120px;
                    padding-right: 5px;
                    text-align: right;
                }
                .demo-section .k-button {
                    margin: 20px 0 0 125px;
                }
                .k-readonly
                {
                    color: gray;
                }
            </style>

            <script>
                $(document).ready(function() {
                    var categories = $("#categories").kendoComboBox({
                        placeholder: "Select category...",
                        dataTextField: "categories",
                        dataValueField: "id",
                        dataSource: {
                            type: "json",
                            serverFiltering: true,
                            transport: {
                                read: "datasources/categories.json"

                            }
                        }
                    }).data("kendoComboBox");

                    var products = $("#products").kendoComboBox({
                        autoBind: false,
                        cascadeFrom: "categories",
                        placeholder: "Select product...",
                        dataTextField: "ProductName",
                        dataValueField: "Productsku",
                        dataSource: {
                            type: "json",
                            serverFiltering: true,
                            transport: {
                                read: "datasources/offerProducts.json"
                            }
                        }
                    }).data("kendoComboBox");


JSON

[{
    "categories": "Discount",
    "id": 1,
}, {
    "categories": "Points",
    "id": 2,
}, {
    "categories": "Member Status",
    "id": 3,
}, {
    "categories": "Charity",
    "id": 4,
}, {
    "categories": "Special Occasions",
    "id": 5,
}]
Dimiter Madjarov
Telerik team
 answered on 28 Mar 2013
1 answer
243 views
Hi i'm quite stuck on initializing multiple cascading DropDown Lists with the MVC wrappers:

The Same sample works with Kendo Web but not with the MVC Wrappers.

All 4 DropDowns get the values from the controller.

You are not allowed to change the first dropdown thats why it is disabled.

all other dropdown should be prefilled with the values from the controller.

The Data from Select Devices is also passed to the client. it look like this:
[{"DeviceId":7,"Name":"Device Customer CA 1"},{"DeviceId":8,"Name":"Device Customer CA 2"},{"DeviceId":9,"Name":"Device Customer CA 3"},{"DeviceId":10,"Name":"Device Customer CA 4"}]

This is the code from the view:


<div class="editor-label">
@Html.LabelFor(model => model.SalesOrgId)
</div>
<div class="editor-field">
@(Html.Kendo().ComboBox()
.Name("SalesOrgId")
.Placeholder(Resources.MappingRules.Strings.SelectSalesOrgDropDown)
.DataTextField("Name")
.DataValueField("SalesOrgId")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SelectSalesOrgs", "MappingRules");
})
.ServerFiltering(true);

})
.Enable(false)
)
@Html.ValidationMessageFor(model => model.SalesOrgId)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.CustomerId)
</div>
<div class="editor-field">
@(Html.Kendo().ComboBox()
.Name("CustomerId")
.Placeholder(Resources.MappingRules.Strings.SelectCustomerDropDown)
.DataTextField("Name")
.DataValueField("CustomerId")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SelectCustomers", "MappingRules").Data("filterCustomers");
})
.ServerFiltering(true);
})
.AutoBind(false)
.CascadeFrom("SalesOrgId")
)
@Html.ValidationMessageFor(model => model.CustomerId)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.DeviceId)
</div>
<div class="editor-field">
@(Html.Kendo().ComboBox()
.Name("DeviceId")
.Placeholder(Resources.MappingRules.Strings.SelectDeviceDropDown)
.DataTextField("Name")
.DataValueField("DeviceId")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SelectDevices", "MappingRules").Data("filterDevices");
})
.ServerFiltering(true);
})
.AutoBind(false)
.CascadeFrom("CustomerId")
)
@Html.ValidationMessageFor(model => model.DeviceId)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.EntityId)
</div>
<div class="editor-field">
@(Html.Kendo().ComboBox()
.Name("EntityId")
.Placeholder(Resources.MappingRules.Strings.SelectEntityDropDown)
.DataTextField("Name")
.DataValueField("EntityId")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SelectEntities", "MappingRules");
})
.ServerFiltering(true);
})
.AutoBind(false)
.CascadeFrom("DeviceId")
)
@Html.ValidationMessageFor(model => model.EntityId)
</div>

Here ist my controller code:

public JsonResult SelectSalesOrgs()
{
  var salesOrgs = GetSalesOrgs();
  return Json(salesOrgs, JsonRequestBehavior.AllowGet);
}

public JsonResult SelectCustomers(int salesOrgId)
{
  var customers = GetCustomersBySalesOrgId(salesOrgId);
  return Json(customers, JsonRequestBehavior.AllowGet);
}

public JsonResult SelectDevices(int customerId)
{
  var devices = GetDevicesByCustomerId(customerId);
  return Json(devices, JsonRequestBehavior.AllowGet);
}

public JsonResult SelectEntities()
{
var entities = GetEntities();
return Json(entities, JsonRequestBehavior.AllowGet);
}

Any help would be appreciated.
Daniel
Top achievements
Rank 1
 answered on 28 Mar 2013
3 answers
262 views
Hi,

I would like to change the icon of a tabstrip element programmatically.
I have done some research and found this link:
http://www.kendoui.com/forums/mobile/listview/mobile-change-listview-data-icon.aspx

However, when I try to apply it, it does not work.
My code is as follow:

var oldIcon = $('#messageViewLink').attr('data-icon');
var newIcon = 'home';
$('#messageViewLink').attr('data-icon', newIcon);
$('#messageViewLink').find('.km-icon').addClass('km-' + newIcon).removeClass('km-' + oldIcon);

More importantly, the following three statements return false:
    alert($('#messageViewLink').hasClass('km-icon'));
    alert($('#messageViewLink').hasClass('km-'+newIcon));
    alert($('#messageViewLink').hasClass('km-'+oldIcon));
    
Please help. Thanks.

BR,
Ralph
Kamen Bundev
Telerik team
 answered on 28 Mar 2013
1 answer
90 views
Hi Kendo Team:
I've read the breaking changes of the new Kendo UI Q1 2013. Do you have any tool that renames   enable forenabled  option in all my javascript files where I use a comboBox?
How do we customers usually move from one kendo version to another?
Any help will be appreciated.

Kind Regards.
Oscar.
Alexander Valchev
Telerik team
 answered on 28 Mar 2013
1 answer
56 views
on Android 4.2 - Input type date is always crashing when the input is empty and when i set a value and then click on the field and choose set, it add to the field as its not clearing before adding, kindly be informed that i'm using Icenium to deploy my app to the mobile,
the mobile version is Samsung S3 and OS is Android 4.2

and for code example, just create a new project with icenium with Kendo Mobile template and deploy it to an android phone. 
Petyo
Telerik team
 answered on 28 Mar 2013
6 answers
588 views
I need to enter a multiline text within the grid, any solution for this?


schema: {
                    data:"data",
                    total: "total",
                    model: {                        
                        id: "id",
                        fields: {                            
                             
   I need to enter multiline text in this field 
                            cont: { type: "string", name: "contenido", validation: { required: true } }

                        }
                    }
                    
                }
Jan Houwen
Top achievements
Rank 1
 answered on 28 Mar 2013
2 answers
113 views
Hi Kendo team,

just want to tell you, that I have found quite an interesting bug. Steps to reproduce:
1) Head over to your web demos at: demos.kendoui.com/web/grid/aggregates.html
2) Sort by 'Unit price'.
3) As you can see (e.g. page 1, 4, ...), all "more than two digit" prices are sorted wrong - it seems only first two digits are taken into account.

Or is this intentional? Attaching screenshot as a proof.

Have a nice day.
Petur Subev
Telerik team
 answered on 28 Mar 2013
1 answer
175 views
Hello,
I have a chart filled by a JSON remote data.

Here is the result of the JSON :
[{"Id":0,"Date":"2013-03-22 11:59:25","Value":"250"},{"Id":1,"Date":"2013-03-22 11:59:27","Value":"250"},{"Id":2,"Date":"2013-03-22 11:59:29","Value":"250"},{"Id":3,"Date":"2013-03-22 11:59:31","Value":"250"},{"Id":4,"Date":"2013-03-22 11:59:33","Value":"250"},{"Id":5,"Date":"2013-03-22 11:59:35","Value":"250"},{"Id":6,"Date":"2013-03-22 11:59:37","Value":"260"},{"Id":7,"Date":"2013-03-22 11:59:39","Value":"250"},{"Id":8,"Date":"2013-03-22 11:59:41","Value":"250"},{"Id":9,"Date":"2013-03-22 11:59:43","Value":"250"}]

The problem is that I only have 1 value appearing on the graph with the time to 11:59:00
I guess it's because seconds are not taken  into account, so all values are "viewed" at the same time so it's only 1 point.

Below my code for the chart :
$("#example").kendoChart({
            theme: "default",
            dataSource: {
                transport: {
                    read: {
                        url: '@Url.Action("GetHydrogen", new { Area = "Plugins", Controller = "Temperature" })
                        contentType: "application/json",
                        dataType: "json"
                    }
                },
                sort: {
                    field: "Date",
                    dir:"asc"
                }
            },
            title: {
                text: "Hydrogen"
            },
            seriesDefaults: {
                type: "line",
                missingValues: "gap"
            },
            series:
                [{ field: "Value", name: "Value" }],
            categoryAxis: {
                field: "Date",
                type: "date",
                labels : { step: 5, font: "8px Arial, Helvetica, sans-serif", template: "#=kendo.toString(new Date(value), 'dd/MM HH:mm:ss')#"},
                maxDateGroups: 100,
                baseUnit: "fit",
                baseUnitStep: "auto",
                majorGridLines: "none",
                crosshair: {
                    visible: true,
                    tooltip: {
                        visible: true,
                        template: "|#= value #|"
                    }
                }
                
            },
            valueAxis: {
                labels: {
                    format: "{0}"
                }
            },
            tooltip: {
                visible: true,
                template: "${category} - ${value}"
            }
        });

Thanks for your help
Sylvain
Hristo Germanov
Telerik team
 answered on 28 Mar 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?