This is a migrated thread and some comments may be shown as answers.

Separate datasource for sushi example

2 Answers 180 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Fajar
Top achievements
Rank 1
Fajar asked on 08 Mar 2012, 03:31 AM
Hi there, I am new to kendoui, but I really like the way kendoui can show native feels on android, blackberry and ios devices.

I am trying to follow the sushi demo apps. But looking at the code, I notice that the checkout button doesn't do any actual server call. Unlike the menu who actually use a read transport. So, I am trying to do my practice by continuing upon the sushi demo. I have setup my rails server to response to /menus and give back array of menu json object. And I also create a separate url for order /orders. My Idea is to use order as a wrapper of menus so generally order json object will look like so:
{ id: "1", date: "today", menu: {...../*menu json object here*/} } 

But I am having trouble to make this works. So I created two data source for this:
one for /menus and the other one for /orders

        var ds = kendo.data.DataSource.create({
            schema: schema,
            transport: { read: { url: "menus", dataType: "json" } },
            group: "category",
            error: function() { console.log(arguments); }
        });

        var cartDataSource = kendo.data.DataSource.create({
            //data: [], 
            schema: schema2,
            transport: { create: { url: "orders", type: "POST" },  read: { url: "orders", dataType: "json" }},
            aggregate: [{ field: "menu.price", aggregate: "sum" }]
        });

Any idea on what do I do wrong?

Thank you in advance,
Fajar

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 09 Mar 2012, 08:51 AM
Hi,

I am not sure what the problem may be. Do you call The sync method of the dataSource? You can read more about it in the dataSource documentation

Regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Fajar
Top achievements
Rank 1
answered on 10 Mar 2012, 12:32 PM
Hi,

I am going back to simpler example (shoe) where you use rails server and more basic datasource use case. Hopefully it can help me understand faster. Could you please help me on my problem now.

http://www.kendoui.com/forums/framework/data-source/datasource-create-sends-incorrect-parameter-to-rails-server.aspx

Thanks
Tags
Data Source
Asked by
Fajar
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Fajar
Top achievements
Rank 1
Share this question
or