1. #61
    Ext User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    0
    feanor73 is on a distinguished road

      0  

    Default


    Quote Originally Posted by Psychokrameur View Post
    Hi,

    You're extension was really great. I'm happy that you still work on it.

    However, I notice some problem. Try to add an element, remove it, add again.
    The available selection grows... but with duplicate items.

    The link to the demo doesn't work.

    Finally, I agree with galdaka suggestion and could be good to have a reset function which remove boxes (caption and on the store) and free-element.

    Even if you don't want to add this functionnality, could explain me how to get and to remove the RawValue properly.


    If it helps, I fixed the problem with "Try to add an element, remove it, add again.
    The available selection grows... but with duplicate items." by uncommenting one line of code in the remove function of the BoxSelect.Item like so:


    PHP Code:
                    'remove': function(box){
                        
    delete this.selectedValues[box.value];
                        var 
    rec this.removedRecords[box.value];
                        if(
    rec){
                            
    this.store.add(rec);
                            
    this.sortStore();
                            
    this.view.render();
                            
    this.removedRecords[box.value] = null// this is the change - prevents removed rows from duplicating in backing store
                        
    }
                    }, 
    I'm not sure what side effect this change causes (there probably was a reason that the line of code was commented out to begin with), but so far so good on my end.

  2. #62
    Ext User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    0
    feanor73 is on a distinguished road

      0  

    Default


    Quote Originally Posted by galdaka View Post
    Hi,

    Sorry for my English,

    Excellent work. One question: Is posible combine free (non-defined) values with pre-defined (In combobox) values?

    I think would be a good idea define a separator as parameter and when you write non-defined value enter separator and make posible expand combobox again for enter new value. This new value will have a diferent css or color (For mark as non-predefined).

    Thanks in advance,

    I need this ability as well. In my app, I decided to delimit free text with a semicolon ";". This allowed me to add the following method to the BoxSelect:

    PHP Code:
        initEvents : function(){
            
    Ext.ux.BoxSelect.superclass.initEvents.call(this);
            var 
    keyMap = new Ext.KeyMap(this.el, {

                
    key";",
                
    fn: function(e){
                    if(
    this.editable !== false) {
                        
    this.addItem(this.lastValuethis.lastValue);
                        
    this.setRawValue('');
                        
    this.lastSelectionText '';
                        
    this.applyEmptyText();
                    }
                },
                
    scope this,
                
    forceKeyDown true
            
    });
        }, 
    I haven't tested this much and I am sure it is not very flexible, but it seems to work in the context of my application.

    Hope that helps someone out!

  3. #63
    Ext User
    Join Date
    Mar 2008
    Location
    Kingdom of Serbia
    Posts
    6
    Vote Rating
    0
    mirko is on a distinguished road

      0  

    Question max height

    max height


    Great extension. Is it possible to set max height (max grow)?

  4. #64
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by feanor73 View Post
    I need this ability as well. In my app, I decided to delimit free text with a semicolon ";". This allowed me to add the following method to the BoxSelect:

    PHP Code:
        initEvents : function(){
            
    Ext.ux.BoxSelect.superclass.initEvents.call(this);
            var 
    keyMap = new Ext.KeyMap(this.el, {
     
                
    key";",
                
    fn: function(e){
                    if(
    this.editable !== false) {
                        
    this.addItem(this.lastValuethis.lastValue);
                        
    this.setRawValue('');
                        
    this.lastSelectionText '';
                        
    this.applyEmptyText();
                    }
                },
                
    scope this,
                
    forceKeyDown true
            
    });
        }, 
    I haven't tested this much and I am sure it is not very flexible, but it seems to work in the context of my application.

    Hope that helps someone out!
    Not work!!

    Live example: http://www.jadacosta.es/extjs/exampl...ect/index.html

  5. #65
    Sencha Premium Member joseadriano's Avatar
    Join Date
    Aug 2008
    Location
    Douradina, Brazil
    Posts
    15
    Vote Rating
    0
    joseadriano is on a distinguished road

      0  

    Default Very Good

    Very Good


    Thank you, helping to improve more and more ExtJS funcionalities.

  6. #66
    Ext User
    Join Date
    May 2007
    Posts
    22
    Vote Rating
    0
    efiebba is on a distinguished road

      0  

    Default


    Hello

    Some days ago i asked about some problems with this nice extension. I think the solution is, that it only works with ext 2.2 - Is it correct?

    Bastian

  7. #67
    Ext User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    0
    feanor73 is on a distinguished road

      0  

    Default


    Quote Originally Posted by galdaka View Post

    I noticed 2 problems:
    1. In IE7, it doesn't put the box around the text. It works in Firefox 2.0. I will eventually have to get it to work in IE7! To get the box to appear, you need to type your text and then a semi colon. So, without the quotes you type "Test;".

    2. getValue() doesn't seem to work in either browser in your live example with my change. I'm not sure why without debugging it. I just post the contents of the field in my app and that seems to work.

    Sorry.

  8. #68
    Sencha User
    Join Date
    Jun 2008
    Posts
    38
    Vote Rating
    0
    Psychokrameur is on a distinguished road

      0  

    Default


    Thanks feanor73,

    I'll test it soon.

  9. #69
    Ext User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    0
    feanor73 is on a distinguished road

      0  

    Default


    Quote Originally Posted by feanor73 View Post
    I noticed 2 problems:
    1. In IE7, it doesn't put the box around the text. It works in Firefox 2.0. I will eventually have to get it to work in IE7! To get the box to appear, you need to type your text and then a semi colon. So, without the quotes you type "Test;".

    2. getValue() doesn't seem to work in either browser in your live example with my change. I'm not sure why without debugging it. I just post the contents of the field in my app and that seems to work.

    Sorry.

    I think I fixed problem 1.

    IE and Firefox seem to treat character codes differently with regards to the semi-colon. (that's conjecture on my part).


    So, I tried this in the KeyMap setup and it seemed to work (didn't try chrome, safari, or opera):
    PHP Code:
                var key ";";
                if( 
    Ext.isIE ) {
                    
    key 186;
                }
                var 
    keyMap = new Ext.KeyMap(this.el, {

                    
    keykey,
                    
    fn: function(e){
                        if(
    this.editable !== false) {
                            
    this.addItem(this.lastValuethis.lastValue);
                            
    this.setRawValue('');
                            
    this.lastSelectionText '';
                            
    this.applyEmptyText();
                        }
                    },
                    
    scope this,
                    
    forceKeyDown true
                
    }); 

  10. #70
    Sencha User
    Join Date
    Nov 2008
    Posts
    16
    Vote Rating
    0
    hugo69 is on a distinguished road

      0  

    Question


    I just find this extension... waw!!! what a great job !


    I am newbie at ExtJs and I encontoured some problems with performance.

    I want to use it for a search field.
    So, I made a JSON Store with all the keyword in the database. (between 5.000 and 10.000 words).

    The problem is:
    - When i click in the field, I have to wait a few second, I think the program is loading with Javascript the data
    - When i type some letters, at the second letter, it takes a long time to look into the Store with Javascript, I can see my Processor charge...

    I also tried with a 'REMOTE' way, but, it's too long..

    in local the problem is that Javascript is overcharging my UC and in remote, the request is too long...

    I have filtered in maximum my store, by overpassing words smaller than 4 letters....etc...

    Any idea?

    Here is my code:

    Code:
    var keywordJReader = new Ext.data.JsonReader({
                                totalProperty: 'totalCount',
                                root: 'records', 
                                }, 
                                [{name: 'name'}]
                            );
     
        var keywordStore = new Ext.data.Store({
                                proxy: new Ext.data.HttpProxy({
                                    url: 'tools/ajax.php',
                                    method: 'POST'
                                }),
                                baseParams:{action: 'keyword'},
                                reader: keywordJReader,
                                autoLoad: true
                            });
    
    
    var myK = new Ext.ux.BoxSelect({
                    fieldLabel: 'Keyword',
                    resizable: false,
                    name: 'keyword[]',
                    forceSelection :true,
                    store: keywordStore,
                    mode: 'local',
                    displayField: 'name',
                    displayFieldTpl: '{name}',
                    valueField: 'name',
                    addUniqueValues: false
                })
    Here is the PHP JSON store for test:
    Code:
    $json = Array();
                    $json['success'] = 'true';
                    $json['totalCount'] = 5000;
                    $records=array();
                    $json['records'] = &$records;
    
                    
                        for($i=0;$i<5000;$i++)
                        {                            
                            $myArray=array();
                            $myArray['name']="test".$i;
                            $records[]=$myArray;
                            unset($myArray);
                        }
                    
                    echo json_encode($json);

    Thank for your help!