PDA

View Full Version : Using Json data in Sencha touch



nhannguyenbt
3 Aug 2012, 8:17 PM
Hi guys,

First, sorry for my English skill :">

I'm a newbie and i have a question:

I use Json and NestedList to binding data for my Application

Here is my json data:


{
"items": [
{
"id": 1,
"text": "Fashion",
"img_tmb": "resources/images/products/sominam.jpg",
"leaf": true,


"products": [
{
"id": 11,
"text": "Jean",
"weight": "120/25 grm",
"price": 27,
"img_tmb": "resources/images/products/jean.jpg",
"leaf": true
},
{
"id": 12,
"text": "kaki",
"weight": "100 grm",
"price": 34,
"img_tmb": "resources/images/products/kaki.jpg",
"leaf": true
}]
},

"id": 2,
"text": "Food",
...................

}

That mean I just get products from Fashion and Food category.

Now I want to put the Shop into database. It look like:

Category(Cat_ID, Cat_name)
Shop(Shop_ID, Shop_name, Cat_ID)
Product(Pro_ID, Pro_name, Shop_ID, Cat_ID)

I want to creat 2 tab panels call Category and Shop,
if I click on Category, app will show the list of Category -> products.
if I click on Shop panel, app will show the list of Shop -> products

So how do I create database and binding data into my app

Thanks and best regard.

(Sorry for my English skill :D)

kostysh
5 Aug 2012, 2:27 PM
Do not try to create complex app without core knowlege. You should dive into Sencha step by step.
At first, learn how works stores in Sencha http://docs.sencha.com/touch/2-0/#!/guide/stores


Official documentation contains to many useful guides and examples.


As example of shop application you can use demo app from this repository: https://github.com/kostysh/Simple-shopping-cart-for-Sencha-Touch-2

BurhanB
8 Dec 2012, 2:26 AM
Hi, Well I am new to sencha touch and wants to use JSON in sencha touch .. Please kindly help me How I can use JSON in sencha touch
Thanx in advance.