Initialize from array

2 posts, 0 answers
  1. Jonas
    Jonas avatar
    33 posts
    Member since:
    Sep 2009

    Posted 13 Oct 2012 Link to this post

    Hi, what am I missing? I'm trying to initialize a datasource with a simple array as data, just like in the documentation http://docs.kendoui.com/api/framework/datasource#methods
    . But I cannot get it working.

        var orders = [ { orderId: 10248, customerName: "Paul Smith" }, { orderId: 10249, customerName: "Jane Jones" }];
    var dataSource = new kendo.data.DataSource({
         data: orders
    });
         
       var order = dataSource.at(0);
         
       if (typeof(order)=="undefined") {
           alert("fail");
       } else {
           alert(order.customerName);
       };


    http://jsfiddle.net/HB8NZ/

    thanks
  2. Jonas
    Jonas avatar
    33 posts
    Member since:
    Sep 2009

    Posted 13 Oct 2012 Link to this post

    ah, I need to call .read()
    http://jsfiddle.net/HB8NZ/1/
     
  3. Kendo UI is VS 2017 Ready
Back to Top