Ext. Data. jsonstore

Source: Internet
Author: User
Ext. Data. jsonstore is also a sub-class of store, with the goal of making it easier to use JSON objects as data sources.
Fields and root are added in the structure. The usage is as follows:
/**//*
This is a remote object. The returned content is consistent with the data of the local object below.
VaR store = new Ext. Data. jsonstore ({
URL: 'jsoncallback. js' ,
Root: 'rows ',
Fields: ['id', 'name', 'occupation']
});
Store. Load ();
*/
VaR store = new Ext. Data. jsonstore (...{
Data:... {'results': 2, 'rows ':[
... {'Id': 1, 'name': 'Bill ', Occupation: 'gardener '},
... {'Id': 2, 'name': 'ben', Occupation: 'horticulturalist '}
]},
Autoload: True,
Root: 'rows ',
Fields: ['id', 'name', 'occupation']
})

// skip gridpanel before proceeding.
var grid = new Ext. grid. gridpanel (... {
DS: store,
columns: [
... {header: "ID", width: 200, sortable: True, dataindex: 'id'},
... {header: "name", width: 200, sortable: True, dataindex: 'name'},
... {header: "Occupation", width: 200, sortable: True, dataindex: 'occupation'}
], height: 350,
width: 620,
title: 'array grid',
renderto: 'div _ gridpanel '
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.