Telerik Forums
Kendo UI for jQuery Forum
0 answers
141 views
HI,
    I'm using the listview to act as a form in the same way you have in your demo's. I would like to be able to add some items dynamically to the end of the listview based on some code logic. Because this is not using a datasource as all the common items are declared in html code at designtime, how would I go about adding the extra non common items to listview.items() at runtime. 

Or I could use a dataSource but then how can I specify what template each item should have when they would not all want the same template.

Thanks 
Paul
Top achievements
Rank 1
 asked on 11 Sep 2012
1 answer
180 views
What is different between kendo.default.less and kendo.default.css? And also how to use .less file in html-jquery application?
Dimo
Telerik team
 answered on 11 Sep 2012
7 answers
259 views
I am getting following error multiple time while I am generating Line Chart for more than 100 items.

A script on this page is causing your web browser to run slowly. If it continues to run, your computer might become unresponsive.

ASPX Page

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="KendoUIDemo._Default" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script src="Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="Scripts/kendo.dataviz.min.js" type="text/javascript"></script>
    <script src="Scripts/console.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">


    <div id="example" class="k-content" >
        <div class="chart-wrapper">
            <div id="chart" >
            </div>
        </div>
    </div>
    Random Data:
    <asp:TextBox ID="txtNo" runat="server" Text="10" />
    <asp:Button runat="server" ID="btnData" Text="Get Data" /><br />
    <asp:TextBox ID="txtSerializeData" runat="server" Text="10" ClientIDMode="Static" />


    <br />
    <input type="button" onclick="createChart();" value="Visualize" />
    <asp:DataGrid ID="gvData" runat="server" AutoGenerateColumns="false">
        <Columns>
            <asp:BoundColumn DataField="Date" HeaderText="Date" DataFormatString="{0:MM/dd}" />
            <asp:BoundColumn DataField="onCR" HeaderText="onCR" DataFormatString="{0:f2}" />
            <asp:BoundColumn DataField="offCR" HeaderText="offCR" DataFormatString="{0:f2}" />
        </Columns>
    </asp:DataGrid>
    <script type="text/javascript">


        function getArray() {


            return [15.7, 16.7, 20, 23.5, 26.6];


        }


        function getDatafromGrid(grid, columnIndex) {
            var t = "";


            $(grid + " tr:has(td)").each(function () {
                var col = $(this).find("td")
                t = t + $(col[columnIndex]).html() + ", ";
            });




            return t.substring(t.indexOf(",") + 1, t.lastIndexOf(",")).split(",");


        }








        function createChart() {


            var w = getDatafromGrid("#<%= gvData.ClientID %>", 0).length * 40;


            w = (w < $(this).width()) ? $(this).width() : w;
            
            $("#chart").width(w);
            $("#chart").kendoChart({
                theme: $(document).data("kendoSkin") || "default",
                dataSource: {
                    data: eval(document.getElementById("txtSerializeData").value)
                        },
                title: {
                    text: "On CR Vs off CR"
                },
                legend: {
                    position: "bottom"
                },
                seriesDefaults: {
                    type: "line",
                    stack: false
                },
                series: [{
                    field: "onCR",
                    name: "On CR"
                }, {
                    field: "offCR",
                    name: "Off CR"
                }],
                valueAxis: {
                    labels: {
                        format: "{0}%" 
                    }
                },
                categoryAxis: {
                    field: "Date",
                    rotate:90
                },
                tooltip: {
                    visible: true,
                    format: "{0}%"
                }
            });




        }


 
        // createChart();
        //                $(document).ready(function() {
        //                    setTimeout(function() {
        //                        createChart();
        // 
        //                        $("#example").bind("kendo:skinChange", function(e) {
        //                            createChart();
        //                        });
        //                    }, 400);
        //                });


    </script>
</asp:Content>




//C# Code Behind

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Script.Serialization;


namespace KendoUIDemo
{
    public class GraphData
    {
        public string Date { get; set; }
        public string onCR { get; set; }
        public string offCR { get; set; }


    }


    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {


                FillData();


      


            


        }




        private void FillData() {


            DataTable dt = new DataTable();
            dt.Columns.Add("Date", typeof(DateTime));
            dt.Columns.Add("onCr", typeof(Double));
            dt.Columns.Add("offCr", typeof(Double));


            Random r = new Random();


            int range =10;


            int.TryParse(txtNo.Text, out range);
            List< GraphData> rows = new List<GraphData>();


            for (int i = 1; i < range+1; i++)
            {


                GraphData g = new GraphData{Date = DateTime.Now.AddDays(i).ToString("MM/dd"), offCR = (r.NextDouble() * 100).ToString("0.00"), onCR = (r.NextDouble() * 100).ToString("0.00")};


                DataRow dr = dt.NewRow();


                dr["Date"] = DateTime.Now.AddDays(i).Date;
                dr["onCr"] = g.onCR ;
                dr["offCr"] = g.offCR;
                
                rows.Add(g);


                dt.Rows.Add(dr);
            
            }


            dt.AcceptChanges();


            gvData.DataSource = dt;
            gvData.DataBind();




            
            string jsonString = JsonHelper.JsonSerializer<List<GraphData>>(rows);


            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string jsonData = serializer.Serialize(rows);
            txtSerializeData.Text = jsonData;


        }


    }
}




//Helper Class for Creating JSON Data


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;


namespace KendoUIDemo
{




        public class JsonHelper
        {
            /// <summary>
            /// JSON Serialization
            /// </summary>
            public static string JsonSerializer<T>(T t)
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
                MemoryStream ms = new MemoryStream();
                ser.WriteObject(ms, t);
                string jsonString = Encoding.UTF8.GetString(ms.ToArray());
                ms.Close();
                return jsonString;
            }
            /// <summary>
            /// JSON Deserialization
            /// </summary>
            public static T JsonDeserialize<T>(string jsonString)
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
                MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
                T obj = (T)ser.ReadObject(ms);
                return obj;
            }
        }
    
}





T. Tsonev
Telerik team
 answered on 11 Sep 2012
1 answer
174 views
When updating a field directly bound to a model both the Set and Changed events on the model are triggered. However when I update a field that has beeen bound using a template, only the changed event is triggered.
I guess I'm doing something wrong.
An example of the issue is here
http://jsfiddle.net/stephenrjames_uk/K8Q6D/3/

If you update the Template Field you will see just the changed event firing whereas updating the bound field triggers 1 set and 3 changed events.
Alexander Valchev
Telerik team
 answered on 11 Sep 2012
0 answers
100 views
hello,

I  use the codeigniter php mvc.

I seed the Endless scrolling remote url is http://search.twitter.com/search.json?q=javascript&rpp=10&page=1

and page++ , but I use the codeigniter , it just work at like http://search.twitter.com/search.json/javascript/10/1 , can't use get parameter.

how can I solve it?

sorry for my bad english.
Vence
Top achievements
Rank 1
 asked on 11 Sep 2012
1 answer
123 views
ListView selection demo is not working when using jquery 1.8.1 (1.7.1 works well).
Is there any quickfix for this issue? 
Thanks,
-Kirill.
Iliana Dyankova
Telerik team
 answered on 11 Sep 2012
1 answer
242 views
Hello,

Consider the following code we tried out in the Dojo:

// Add chart configuration code
$("#donut").kendoChart({
    theme: $(document).data("kendoSkin") || "default",
    title: {
        text: "World population by age group and sex"
    },
    legend: {
        visible: false
    },
    seriesDefaults: {
        type: "column"
    },
    series: [{
        name: "0-19",
        stack: "Female",
        data: [1100941, 1139797]
    }, {
        name: "20-39",
        stack: "Female",
        data: [810169, 883051]
    }, {
        name: "0-19",
        stack: "Male",
        data: [-1155600, -1202766]
    }, {
        name: "20-39",
        stack: "Male",
        data: [-844496, -916479]
    }],
    seriesColors: ["#cd1533", "#d43851", "#dc5c71", "#e47f8f"],
    valueAxis: {
        labels: {
            template: "#= kendo.format('{0:N0}', value / 1000) # M"
        }
    },
    categoryAxis: {
        categories: [1990, 1995]
    },
    tooltip: {
        visible: true,
        template: "#= series.stack #s, age #= series.name #"
    }
});

It's just a short version of the demo code for stacked and grouped bars, but once you get into negative values, some of them stack up as positive instead of negative...

See screenshot too.

Thanks!
T. Tsonev
Telerik team
 answered on 11 Sep 2012
1 answer
116 views
I have a grid that is formatting the dates correctly when the grid initially loads.  We have a toolbar with a drop down that will send a request to the server to fetch new data.  When I insert the returned data into the grid, the date formatting goes away.  

I included a small example of what is happening.  The "Bind to Data Source" button is replacing the data through the kendo.data.DataSource object and the "Bind to Grid Data" button is replacing the data through the grid's datasource (I know it's essentially the same thing but I thought I'd try both methods anyway).

The only thing I can think of is if I destroy the grid and render a new one every time I fetch data.  That's not a horrible problem but I didn't know if there was a more elegant way of doing this.

Thanks!

Here's a fiddle: http://jsfiddle.net/schapman/ypKrC/1/ 
Nikolay Rusev
Telerik team
 answered on 11 Sep 2012
1 answer
128 views
Hi,

I am receiving an error in the grid navigator after I update the datasource and refresh a grid.

To update the dataSource in a Grid I do this:
MyGrid.dataSource.data(myDataSource);
MyGrid.refresh();

 When I first create my grid everything works fine, but after the update above, when I click on a page number I receive the following error:
DOM Exception: NOT_FOUND_ERR (8)

The error occurs inside kendo.ui.all.min.js in the statement c.table[0].replaceChild(i,c.tbody[0]).

Can you help me ???
Jendusak
Top achievements
Rank 1
 answered on 11 Sep 2012
1 answer
104 views
Recently i start work with titanium for developing ios apps and androis apps , so i want to know is this kendoUI support titanium ,
if Yes then how to configure it in mac os. ?

which is better platform for developing ios and android apps and games? [ optional question]
Ali
Top achievements
Rank 1
 answered on 11 Sep 2012
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?