1. #21
    Ext User lgerndt's Avatar
    Join Date
    Apr 2007
    Location
    Sunnyvale, CA
    Posts
    48
    Vote Rating
    0
    lgerndt is on a distinguished road

      0  

    Default SelectGroupBox updated for Ext 2.0 is located here

    SelectGroupBox updated for Ext 2.0 is located here


    I did indeed update SelectGroupBox for Ext 2.0. The new code is posted here.

  2. #22
    Sencha Premium Member
    Join Date
    Mar 2008
    Location
    San Jose, CA
    Posts
    124
    Vote Rating
    0
    surfyogi is on a distinguished road

      0  

    Default


    I appreciate the quick replies; unfortunately they don't help me here.
    I just want a simple example that works; unfortunately, the example I posted that I've updated to use the current versions of ext-all, base, SelectBox and states.js does not work.

    Still looking at why... if I replace the ux.SelectBox with form.ComboBox, it works..
    if I move .render to applyTo within the combobox declaration as a parameter.

    Any idea why this example doesn't work?

    Ext.onReady(function() {
    // simple array store
    var store = new Ext.data.SimpleStore({
    fields: ['abbr', 'state'],
    data : Ext.exampledata.states // from states.js
    });
    var combo = new Ext.ux.SelectBox({
    store: store,
    displayField:'state',
    mode: 'local',
    triggerAction: 'all',
    selectOnFocus:true,
    applyTo: 'local-states'
    });
    });

    But this one does?

    Ext.onReady(function() {
    // simple array store
    var store = new Ext.data.SimpleStore({
    fields: ['abbr', 'state'],
    data : Ext.exampledata.states // from states.js
    });
    var combo = new Ext.form.ComboBox({
    store: store,
    displayField:'state',
    mode: 'local',
    triggerAction: 'all',
    selectOnFocus:true,
    applyTo: 'local-states'
    });
    });

    Also, with a combobox or selectbox, I thought I could set a param for:

    setValue: 'AL'

    and that would make the first item in the states.js come up as default selection, but that does not work under any circumstances I can find. Any clues on how to get a default selection from the store data set?

    thanks!

  3. #23
    Sencha Premium Member
    Join Date
    Mar 2008
    Location
    San Jose, CA
    Posts
    124
    Vote Rating
    0
    surfyogi is on a distinguished road

      0  

    Default


    Did a little debug session here; looks like SelectBox.js may be set up to work with MulitCombo but assumes there is an "innerList" of some kind.

    In the render method, if I comment out references to innerList, the thing just starts working...

    thanks for the code, nice stuff.

    Jeff-

    render : function(ct) {
    Ext.ux.SelectBox.superclass.render.apply(this, arguments);
    if( Ext.isSafari ) {
    this.el.swallowEvent('mousedown', true);
    }
    this.el.unselectable();
    //this.innerList.unselectable();
    this.trigger.unselectable();
    /*
    this.innerList.on('mouseup', function(e, target, options) {
    if( target.id && target.id == this.innerList.id ) {
    return;
    }
    this.onViewClick();
    }, this);
    this.innerList.on('mouseover', function(e, target, options) {
    if( target.id && target.id == this.innerList.id ) {
    return;
    }
    this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
    this.cshTask.delay(this.searchResetDelay);
    }, this);
    */
    ----------------------------------------------------

    So therefore, this SIMPLE example now works:

    Ext.onReady(function(){
    var combo = new Ext.ux.SelectBox({
    store: new Ext.data.SimpleStore({
    fields: ['abbr', 'state'],
    data : [['AL', 'Alabama'],
    ['AK', 'Alaska'],
    ['AZ', 'Arizona']]
    }),
    displayField:'state',
    typeAhead: false,
    mode: 'local',
    editable: false,
    triggerAction: 'all',
    value:'Alabama',
    applyTo: 'local-states'
    });
    });

  4. #24

    Default great stuff

    great stuff


    SelectBox is great stuff! Thanks for working on it!

    Given that SelectBox is really even more basic than ComboBox...

    What are the chances this can be built in to the next version of ExtJS with its own xtype or possibly add all of this functionality into ComboBox, controlled with new config options?

  5. #25
    Ext User
    Join Date
    May 2007
    Posts
    48
    Vote Rating
    0
    ntulip is on a distinguished road

      0  

    Default Issues with selecting a different option

    Issues with selecting a different option


    Has anyone had issues with the selection model on the dropdown?

    I ask because on a Mac both under Safari and Firefox, once you select an item from the dropdown, if you decide to go back and select a different option, the only option available is the one you last selected.

    Any ideas here?

    THanks,
    nick

  6. #26
    Ext User
    Join Date
    Apr 2008
    Posts
    56
    Vote Rating
    0
    extjsF4n is on a distinguished road

      0  

    Default


    Same problem. Happens for me on latest Firefox.

  7. #27
    Ext User
    Join Date
    May 2007
    Posts
    181
    Vote Rating
    1
    akannu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Arthur.Blake View Post
    SelectBox is great stuff! Thanks for working on it!

    Given that SelectBox is really even more basic than ComboBox...

    What are the chances this can be built in to the next version of ExtJS with its own xtype or possibly add all of this functionality into ComboBox, controlled with new config options?
    I agree with this. I know I have expressed my opinion on every thread I got a chance. This is just too close to my heart.

  8. #28
    Ext User
    Join Date
    May 2007
    Posts
    181
    Vote Rating
    1
    akannu is on a distinguished road

      0  

    Default SELECT behavior in recent browsers (FF2 & IE7)

    SELECT behavior in recent browsers (FF2 & IE7)


    I know several people including me have been asking for the behavior of 'matching on initials' to mimic the HTML SELECT control.

    We just noticed that HTML SELECT behaves differently in latest browsers. Assume a combo for US states. In IE6, if I type "AL" the combo first shows Alabama and then switches to Lousiana. Try the same SELECT in IE7 and FF2. If you tpe "AL", the combo will continue to show ALABAMA. Our observation is that the latest browsers seem to work off on a delay factor and if you type reasonably fast it is trying to match for the entire string instead of treating each character as an initial you are trying to match for. If you allow a substantial delay between A & L, then it will try to treat it as initials and give you the IE6 behavior.

    If this is the trend in latest browsers, it seems that we should think about the requests that some of us are making because we dont want to be inconsistent with SELECT in recent browsers.

    Has anyone else noticed what we see? and any thoughts/recommendations?

  9. #29
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    49
    Vote Rating
    0
    scottw is on a distinguished road

      0  

    Default Must set lazyInit to false

    Must set lazyInit to false


    This extension did not initially work for me on Ext 2.2. I was getting the error "this.view has no properties". The solution that I found was to set 'lazyInit' to false on the SelectBox.

    You will find that there are two versions of SelectBox.js on the Ext 2.2 download. One of these (the one in the 'air\samples' directory) has 'lazyInit:false' hard-coded in it, but the other does not. Be careful which you use or just pass in 'lazyInit:false' yourself.

    It is unfortunate that this has to be done because I assume there are some performance implications, particulary for a SelectBox that is never expanded. Anyone have a better fix?

  10. #30
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    49
    Vote Rating
    0
    scottw is on a distinguished road

      0  

    Default SelectBox fix

    SelectBox fix


    As described previously, the SelectBox does not function unless you set lazyInit to false. I came up with another solution. I overloaded the ComboBox method 'initList' and move anything dealing with 'innerList' and 'view' into it as follows:

    Code:
        initList : function(){
    
    		Ext.ux.SelectBox.superclass.initList.apply(this, arguments);
    		
    		this.calcRowsPerPage();
    		
    		this.innerList.unselectable();
    		this.innerList.on('mouseup', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.onViewClick();
    		}, this);
    
    		this.innerList.on('mouseover', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
    			this.cshTask.delay(this.searchResetDelay);
    		}, this);		
        },
    I also removed the 'lazyInit:false'. Here is the complete code:

    Code:
    Ext.ux.SelectBox = function(config){
    	this.searchResetDelay = 1000;
    	config = config || {};
    	config = Ext.apply(config || {}, {
    		editable: false,
    		forceSelection: true,
    		rowHeight: false,
    		lastSearchTerm: false,
    		triggerAction: 'all',
    		mode: 'local'
        });
    
    	Ext.ux.SelectBox.superclass.constructor.apply(this, arguments);
    
    	this.lastSelectedIndex = this.selectedIndex || 0;
    };
    
    Ext.extend(Ext.ux.SelectBox, Ext.form.ComboBox, {
    	// REMOVED - lazyInit: false,
    	initEvents : function(){
    		Ext.ux.SelectBox.superclass.initEvents.apply(this, arguments);
    		// you need to use keypress to capture upper/lower case and shift+key, but it doesn't work in IE
    		this.el.on('keydown', this.keySearch, this, true);
    		this.cshTask = new Ext.util.DelayedTask(this.clearSearchHistory, this);
    	},
    
    	keySearch : function(e, target, options) {
    		var raw = e.getKey();
    		var key = String.fromCharCode(raw);
    		var startIndex = 0;
    
    		if( !this.store.getCount() ) {
    			return;
    		}
    
    		switch(raw) {
    			case Ext.EventObject.HOME:
    				e.stopEvent();
    				this.selectFirst();
    				return;
    
    			case Ext.EventObject.END:
    				e.stopEvent();
    				this.selectLast();
    				return;
    
    			case Ext.EventObject.PAGEDOWN:
    				this.selectNextPage();
    				e.stopEvent();
    				return;
    
    			case Ext.EventObject.PAGEUP:
    				this.selectPrevPage();
    				e.stopEvent();
    				return;
    		}
    
    		// skip special keys other than the shift key
    		if( (e.hasModifier() && !e.shiftKey) || e.isNavKeyPress() || e.isSpecialKey() ) {
    			return;
    		}
    		if( this.lastSearchTerm == key ) {
    			startIndex = this.lastSelectedIndex;
    		}
    		this.search(this.displayField, key, startIndex);
    		this.cshTask.delay(this.searchResetDelay);
    	},
    
    	onRender : function(ct, position) {
    		this.store.on('load', this.calcRowsPerPage, this);
    		Ext.ux.SelectBox.superclass.onRender.apply(this, arguments);
    		/* REMOVED
    		if( this.mode == 'local' ) {
    			this.calcRowsPerPage();
    		}*/
    	},
    
    	onSelect : function(record, index, skipCollapse){
    		if(this.fireEvent('beforeselect', this, record, index) !== false){
    			this.setValue(record.data[this.valueField || this.displayField]);
    			if( !skipCollapse ) {
    				this.collapse();
    			}
    			this.lastSelectedIndex = index + 1;
    			this.fireEvent('select', this, record, index);
    		}
    	},
    
    	render : function(ct) {
    		Ext.ux.SelectBox.superclass.render.apply(this, arguments);
    		if( Ext.isSafari ) {
    			this.el.swallowEvent('mousedown', true);
    		}
    		this.el.unselectable();
    		// REMOVED - this.innerList.unselectable();
    		this.trigger.unselectable();
    		/* REMOVED
    		this.innerList.on('mouseup', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.onViewClick();
    		}, this);
    
    		this.innerList.on('mouseover', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
    			this.cshTask.delay(this.searchResetDelay);
    		}, this);*/
    
    		this.trigger.un('click', this.onTriggerClick, this);
    		this.trigger.on('mousedown', function(e, target, options) {
    			e.preventDefault();
    			this.onTriggerClick();
    		}, this);
    
    		this.on('collapse', function(e, target, options) {
    			Ext.getDoc().un('mouseup', this.collapseIf, this);
    		}, this, true);
    
    		this.on('expand', function(e, target, options) {
    			Ext.getDoc().on('mouseup', this.collapseIf, this);
    		}, this, true);
    	},
    
        initList : function(){
    
    		Ext.ux.SelectBox.superclass.initList.apply(this, arguments);
    		
    		this.calcRowsPerPage();
    		
    		this.innerList.unselectable();
    		this.innerList.on('mouseup', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.onViewClick();
    		}, this);
    
    		this.innerList.on('mouseover', function(e, target, options) {
    			if( target.id && target.id == this.innerList.id ) {
    				return;
    			}
    			this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
    			this.cshTask.delay(this.searchResetDelay);
    		}, this);		
        },
        
    	clearSearchHistory : function() {
    		this.lastSelectedIndex = 0;
    		this.lastSearchTerm = false;
    	},
    
    	selectFirst : function() {
    		this.focusAndSelect(this.store.data.first());
    	},
    
    	selectLast : function() {
    		this.focusAndSelect(this.store.data.last());
    	},
    
    	selectPrevPage : function() {
    		if( !this.rowHeight ) {
    			return;
    		}
    		var index = Math.max(this.selectedIndex-this.rowsPerPage, 0);
    		this.focusAndSelect(this.store.getAt(index));
    	},
    
    	selectNextPage : function() {
    		if( !this.rowHeight ) {
    			return;
    		}
    		var index = Math.min(this.selectedIndex+this.rowsPerPage, this.store.getCount() - 1);
    		this.focusAndSelect(this.store.getAt(index));
    	},
    
    	search : function(field, value, startIndex) {
    		field = field || this.displayField;
    		this.lastSearchTerm = value;
    		var index = this.store.find.apply(this.store, arguments);
    		if( index !== -1 ) {
    			this.focusAndSelect(index);
    		}
    	},
    
    	focusAndSelect : function(record) {
    		var index = typeof record === 'number' ? record : this.store.indexOf(record);
    		this.select(index, this.isExpanded());
    		//this.onSelect(this.store.getAt(record), index, this.isExpanded());
    		// => fixed: this.store.getAt(index) returns a record
    		this.onSelect(this.store.getAt(index), index, this.isExpanded());
    	},
    
    	calcRowsPerPage : function() {
    		if( this.store.getCount() ) {
    			this.rowHeight = Ext.fly(this.view.getNode(0)).getHeight();
    			this.rowsPerPage = this.maxHeight / this.rowHeight;
    		} else {
    			this.rowHeight = false;
    		}
    	}
    });

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar