HTML5 developing mobile Web Apps--sencha Touch (8)

Source: Internet
Author: User

DataView is the most important component in Sencha Touch for visualizing data. The importance of data visualization is self-evident, and any data can be presented to the user in an image manner. At present, how to better visualize is the pursuit of many companies or frameworks. By visualizing data, you can find patterns between data and predict future situations. Let's take a look at How data is visualized in Sencha Touch.

Due to the DataView component content, this part of the study will continue for a later period of time.

First of all nonsense not to say, directly on The code framework using the DataView component.

Launch:function () {var store = ext.create (' Ext.data.Store ', {///define Data fields:[' name ', ' URL '//region (attribute) to define data],data:[{name: ' Tom ', url: ' a.png '},{name: ' Marry ', url: ' b.png '},{name: ' Jack ', url: ' C.png '}, '} ', var tpl = new Ext.xtemplate (//Definition template ' < TPL for= "." > ', ' <div style= ' font-size:12px; " > ', ' <br/> ', ' {name} ', ' </div> ', ' </tpl> '), var dataView = ext.create (' Ext.dataview ', {fullscreen: True,scrollable: ' Vertical ', store:store,itemtpl:tpl,itemcls: ' Bookitem '//css set the corresponding style can}); Ext.Viewport.add (DataView);}


The comments are all in the code, which is explained in more detail here.

The first is to prepare the data, which is also mentioned in the previous blog, here to emphasize. Using the store component to define the data,field defines the properties of the data in the Data Warehouse, where the properties include name and URL . The data can then be defined.

Once we've defined the data store , we'll define the template, which we've talked about before, in fact, using the data to edit the content within the HTML.

Finally, we define the DataView component. the store attribute selects a defined Data Warehouse,itemtpl selects the template that was previously defined so that the template, data, and visualization are linked together. You can also set DataView css styles through the itemcls property .

In our next study, we'll take a deeper look at other properties in the DataView component, and make the best use of DataView to create high-performance data visualizations.

HTML5 developing mobile Web Apps--sencha Touch (8)

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.