Results 1 to 3 of 3

Thread: Ext.ux.grid.DemonPageSizer

  1. #1
    Sencha User demon222's Avatar
    Join Date
    Jan 2008
    Location
    Poland, Warsaw
    Posts
    134

    Default Ext.ux.grid.DemonPageSizer

    Code:
    Ext.namespace('Ext.ux.grid');
    Ext.ux.grid.DemonPageSizer = Ext.extend(Ext.form.ComboBox, {
    	limitText: this.limitText || ' Limit: ',	
    	pageSizes: this.pageSizes ||  [[5, 5], [10, 10], [25, 25], [50, 50], [100, 100], [200, 200], [500, 500]],
    	displayField: 'name',
    	valueField: 'value',
    	typeAhead: true,
    	mode: 'local',
    	width: 60,
    	forceSelection: true,
    	triggerAction: 'all',
    	selectOnFocus: true,
    	initComponent: function () {
    
    		Ext.apply(this, {
    			store: new Ext.data.SimpleStore({
    				fields: ['value', 'name'],
    				data: this.pageSizes
    			})
    		});
    		
    		this.on({
    			scope: this,
    			render: {
    				fn: this.setDefault
    			}				
    		});			
    
    		Ext.ux.grid.DemonPageSizer.superclass.initComponent.apply(this, arguments);
    	},
    
    	init: function (pagingToolbar) {
    		pagingToolbar.on('render', this.onInitView, this);
    	},
    
    	onInitView: function (pagingToolbar) {
    
    		pagingToolbar.insert(12, '-');
    		pagingToolbar.insert(12, this);
    		pagingToolbar.insert(12, this.limitText);
    
    		this.on('select', this.onPageSizeChanged, pagingToolbar);
    	},
    	onPageSizeChanged: function (combos) {
    		this.pageSize = parseInt(combos.value);
    		this.doLoad(0);
    	},
    	
    	setDefault: function () {
    		this.setValue(  ((parseInt(this.initialSize) > 0) ? this.initialSize : 25)  );
    	}
    
    });
    use:


    Code:
    ...
    	pagingToolbar: function(){
    		return {
    			xtype:'paging',
    			store:this.store,
    			displayInfo:true,
    			plugins: [new Ext.ux.grid.DemonPageSizer()]
    		};
    	},
    ...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,388

    Default

    Maybe tell us what it does and/or post screenshots so we don't have to go through you code to find out.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default

    hi demon,

    it seems a bit similar to the andrie pageSize plugin, but more lightweight.
    http://www.extjs.com/forum/showthrea...drie.pPageSize

    tipp: you only need 1 store field for display / value (displaying pairs of identical values atm).


    kind regards,
    tobiu
    Best regards
    Tobias Uhlig

Similar Threads

  1. TreeGrid (Ext.ux.maximgb.tg) - a tree grid component based on Ext's native grid.
    By MaximGB in forum Ext 3.x: User Extensions and Plugins
    Replies: 127
    Last Post: 9 Oct 2014, 7:51 PM
  2. How to add Ext.grid.CheckColumn to Ext.grid.EditorGridPanel dynamically?
    By Ex_Soft in forum Ext 3.x: Help & Discussion
    Replies: 10
    Last Post: 15 Sep 2010, 12:10 AM
  3. Ext.grid.GridPanel has mouseover, Ext.grid.EditorGridPanel does not?
    By BigBadOwl in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Jun 2008, 9:34 AM
  4. Problem populating second Ext.data.Store after Ext.grid.Grid rowclick event
    By staticboy in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 15 Aug 2007, 5:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •