Use of History in ExtJS

Source: Internet
Author: User

Use of History in ExtJS

// The form object has a record history object-history. This object can be used to achieve previous pages, next pages, and other effects. // Example: history. go () Next page, history. go (-1) Previous Page // use Ext. before history, you must place a form element on the page. You can directly write HTML code to the page, or use the DOM interface of ExtJs to create // ext.getbody(() Doc ument and encapsulate it into Ext. element // call Ext. element. createChild () creates the form Element Ext. onReady (function () {// create form. The form contains a hidden text field and an iframe var historyForm = Ext. getBody (). createChild ({tag: 'form', action: '#', cls: 'x-den ', id: 'History-form', children: [{tag: 'input', id: Ext. history. fieldId, type: 'den den '}, {tag: 'iframe', id: Ext. history. iframeId}]}); // event processing function, which passes in different values to execute different operations var onHistoryChangeHandler = function (token) {lele.info ('browser history changes: '+ token); if (token) {var tabId = parseInt (token. substr (10)-1; console.info (token. substr (10); tabWindow. setActiveTab (tabId) ;}// display the token on the console first, and then call the initialization method (similar to the constructor used to initialize the component) Ext. history. init (); // connect the change event to the event handler Ext. history. on ('change', onHistoryChangeHandler); // create a paging component var tabWindow = new Ext. tabPanel ({title: 'History test', activeTab: 0, items: [{title: 'paging 1', id: 'tab1', html :'
Tab1 '}, {Title: 'paging 2', id: 'tab2', html :' Tab2 '}, {Title: 'paging 3', id: 'tab3', html :' Tab3 '}]}); TabWindow. render ('windowdiv '); var onTabChangeHandler = function (tpObj, tab) {console. debug ('Switch by PAGE, switch to: '+ tab. id); Ext. history. add ('tab _ ID: '+ TAB. id);} tabWindow. on ('tabchang', onTabChangeHandler );}); History

The running effect is as follows:

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.