. NET Extjs4.0 Grid display by PAGE

Source: Internet
Author: User

Yesterday, the EXTJS Grid page of J2EE was completed. NET Extjs Grid paging, the biggest difference is that the paging statements are different, the others are the same: the code on: search. aspx: [html] <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Search. aspx. cs "Inherits =" Search "%> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head runat =" server "> <title> Search </title> <link rel =" stylesheet "type =" text/css "href =" extjs/resources/css /ext-all.css "/> <script type =" text/javascript "src =" extjs/bootstrap. js "> </script> <script type =" text/javascript "src =" extjs/ext-all.js "> </script> <script type =" text/javascript "> // pre-load Ext. require (['ext. grid. * ', 'ext. toolbar. paging ', 'ext. data. * ']); Ext. onReady (function () {// create Mod El Ext. define ('user', {extend: 'ext. data. model ', fields: [{name: 'id', mapping: 'id'}, {name: 'name', mapping: 'name'}, {name: 'date', mapping: 'date'}, {name: 'origin', mapping: 'origin'}]}) // create a data source var store = Ext. create ('ext. data. store', {model: 'user', // set the page size pageSize: 5, proxy: {type: 'ajax ', url: 'pagejson. aspx ', reader: {// the data format is json type: 'json', root: 'buckets', // get the total data totalProperty: 'totalcou Nt '}}, autoLoad: true}); // create grid var grid = Ext. create ('ext. grid. panel ', {store: store, columns: [{text: 'id', width: 120, dataIndex: 'id', sortable: true}, {text: 'name ', width: 120, dataIndex: 'name', sortable: true}, {text: 'gender', width: 120, dataIndex: 'date', sortable: true}, {text: 'age', width: 120, dataIndex: 'origin', sortable: true}], height: 200, width: 480, x: 20, y: 40, title: 'example of ExtJS4 Grid paging query ', renderTo: 'grid', // Pagination function bbar: Ext. create ('ext. pagingToolbar ', {store: store, displayInfo: true, displayMsg:' displays {0}-{1} entries, total {2} entries ', emptyMsg: "No data"}) // store. loadPage (1); store. load ({params: {start: 0, limit: 5 }});}) </script>

Related Article

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.