Ext grid list shows the number of control lines (grid toolbar to add a drop-down list)

I am very excited and relieved to have their own experience to share Ext done to everyone!
I remember once met such a very painful problem!
Is Ext's grid table shows the number of rows to the grid in good control of the original to add a tool bar

      /**
      *@see  The paging toolbar
      */
          var bbar = new Ext.PagingToolbar({
          pageSize : number,
          store : store,
          displayInfo : true,
          displayMsg : ' Display the second   {0}  Bar to the   {1}  Records, a total of   {2}  Bar  ',
          emptyMsg : " No records  "
                });

pageSize: number, the pageSize property has not thought out approach to how to make him dynamic!
Initialization of the display results page article a few are OK, the implementation of the first query shows the number of articles also correct, but changed the number of articles displayed toolbar with the toolbar click Next when the page is initialized according to the display of the number of articles to flip!
Later on the website to ask a number of shrimp, well, have presented a solution!
I am here, then order and sort out!

The following code:

/**
     *@see  The paging toolbar, select the drop-down list
     */
  var pagesize_combo = new Ext.form.ComboBox({
      store: [['5', 5], ['10', 10], ['20', 20], ['50', 50], ['100', 100]],
      width:50,
      readOnly:true,
      emptyText: '20',
      mode: 'remote',
      triggerAction: 'all',
      valueField: 'value',
      displayField: 'text'
     });         

      /**
      *@see  The number of select drop-down list-select event
      */
      pagesize_combo.on("select",function(comboBox){
      bbar.pageSize = parseInt(comboBox.getValue());
      number=parseInt(comboBox.getValue());
      //store.reload({params:{start:0,limit:page_toolbar.pageSize}});
       });     

      /**
      *@see  The paging toolbar
      */
          var bbar = new Ext.PagingToolbar({
          pageSize : number,
          store : store,
          displayInfo : true,
          displayMsg : ' Display the second   {0}  Bar to the   {1}  Records, a total of   {2}  Bar  ',
          emptyMsg : " No records  ",
          items:[ '   Page number  :', pagesize_combo]
                });

      /**
      *@see  A form template
      */
      var grid=new Ext.grid.GridPanel({                                                                                                                         //GridPanel Inherits from the Panel class
      stripeRows:true,
      loadMask:true,
      store:store,                                                                                                                                                                                      //store  On behalf of the above   store  Object
      cm:grid_colum,                                                                                                                                                                            //gird_colum  An object representing the above grid_colum
      sm:sm,
      viewConfig:{
      forceFit:true
      },
      bbar:bbar
      });

In the grid toolbar add a drop-down list pagesize_combo, and added a select to pagesize_combo selected events, in the event function bbar.pageSize = parseInt (comboBox.getValue ()); to change the pageSize value, Ha ha in the know Following this approach, I suddenly realized, in fact, can not use a drop-down list, but do so, it is really nice!

Figure:

Ext grid list shows the number of control lines (grid toolbar to add a drop-down list)

分类:Web 时间:2010-03-31 人气:508
分享到:
blog comments powered by Disqus

相关文章

  • A tool bar plugin like all network following (based on jQuery) 2010-08-17

    /* * Chat Tool Bar plugin * 1.create a chat tool bar, at the bottom of page so in any page user can use web chat tool * 2.create a user list, show who is already online * 3.@author Dahai He * 4.@date 2010-08-16 */ (function(jQuery){ //tool bar name t

  • iOS开发8:使用Tool Bar切换视图 2012-03-16

    之前讨论的都是单视图应用程序,而在实际应用中,我们可能要多个视图,并根据用户的需要切换视图. iOS中几种典型的多视图程序: (1)Tab Bar Application:程序的底部有一排按钮,轻触其中一个按钮,相应的视图被激活并显示出来: (2)Navigation-Based Application:其特点是使用navigation controller,而navigation controller使用navigation bar来控制多级视图: (3)Tool Bar Applicatio

  • Ext grid list shows the number of rows control (to the grid tool bar plus a drop-down list) 2010-03-31

    Today I am excited, his breath did Ext experiences to share for everyone! I remember one occasion, encountered such a very painful problem! Ext is the number of rows of the grid tables show good control of the original in to the grid when you add a t

  • sap abap dynamic tool bar settings 2011-04-01

    Dynamically change the toolbar Can not create multiple toolbars each set form sub_pf_status using rt_extab type slis_t_extab. data ls_extab like line of rt_extab. if sy-tcode = 'z0001'. ls_extab-fcode = 'UPDATE'. append ls_extab to rt_extab. clear ls

  • Twenty-seven workflow system. Net workflow system integrated custom forms 2010-10-08

    . Net custom workflow system integrated form Workflow system generally includes a workflow engine, workflow engine is an abstract business processes, process automation to achieve micro-kernel, use the basic elements of the workflow engine to build a

  • Introduction and application of Chapter VIII PowerBuilder9.0 2010-12-31

    8.1 PowerBuildder9.0 Integrated Development Environment 8.1.1 PB Features (1) using object-oriented programming and event-driven work. (2) to support cross-platform development, with an open database connection system. (3) having to remember all kind

  • android called the hidden settings menu implementation of network information 2010-09-15

    Android calls the built-in wireless information hidden menu Speaking of the recent Android himself with only the "setting" process (ie settings.apk) when found settings.apk encompasses almost all of the settings for android, further careful anal

  • sysstat tool details (a) 2011-08-01

    sysstat tools Summary Understand the composition of sysstat Kit Sar work to understand the configuration of the cumulative Master sar, iostat, mpstat command to use About sysstat tools sysstat is commonly used Linux system kit. Its main purpose is to

  • What Is - Network Diagnostic Tool 2010-03-29

    What Is - Network Diagnostic Tool Last Updated: 19 March 2009 Article Number: DB-00684 Summary This article applies to the following: BlackBerry ® smartphones based on Java ® technology BlackBerry ® Device Software 4.5 and later Details BlackBerry sm

  • displaytag paging _DisplayTag Application Components Implementation Guide _ DisplayTag seven sins _displaytag the Chinese (garbled) solution 2010-04-01

    DisplayTag Application Guide Abstract This paper describes the Web Development and Design: DisplayTag Application Guide, DisplayTag is a very useful table shows labels for MVC model, and its home page in http://displaytag.sourceforge.net First, the s

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.219 (s). 10 q(s)