Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 74

Thread: Ext.ux.form.field.ClearButton - Small clear button/icon over field

  1. #11
    Ext JS Premium Member
    Join Date
    Dec 2007
    Posts
    135

    Default

    Very nice!!! Good work, thank you!!!

  2. #12
    Sencha User grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155

    Default

    +1
    <div style="float: left; width: 70px;">http://appac.us/mcs.png</div><div style="float: left; height: 100px;">Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur</div><div style="clear:both;"></div>

  3. #13
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    370

    Default

    a small bug:
    It should not be active if the field is disabled or readonly.
    You can fix it?
    thanks

  4. #14

    Default

    Nice!

  5. #15

    Default

    Nice!
    Sencha/Java evangelist
    Author of ExtJS 4 First Look and Mastering Ext JS books
    English blog: http://loianegroner.com
    Portuguese blog: http://loiane.com
    Sencha Examples: https://github.com/loiane

  6. #16
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Quote Originally Posted by wki01 View Post
    a small bug:
    It should not be active if the field is disabled or readonly.
    You can fix it?
    thanks
    Yeah, looks like in FF the disabled field is honored and not in IE 8 (didn't test others). And readOnly displays the X as well - at least in FF. Didn't test in IE.

    That said, VERY COOL plugin. I had modified a triggerfield to show/hide the X trigger when there is a value in the field and that worked, but lacked the sexy value this plugin adds. You have any sway with the devs for an inclusion of this feature in 4.2?

  7. #17
    Sencha User Radius-Service's Avatar
    Join Date
    Jul 2010
    Location
    Russia, Perm
    Posts
    47

    Default

    Very good.

    Please add a custom event handler to "clean up".

  8. #18
    Sencha Premium Member austin1030's Avatar
    Join Date
    Feb 2008
    Location
    Hanover, Maryland
    Posts
    103

    Default

    Is there a way not to delete data when the field is set as "readOnly"?

  9. #19
    Sencha User
    Join Date
    Jun 2010
    Location
    Buenos Aires, Argentina
    Posts
    213

    Default

    Thanks for this,

    I'm having problems with combos with multiSelect: true, setValue('') causes that the combo value to be [''] that is not true, combo value must be [] (0 items selected).

    I've to override click and ESC handlers and change se setValue stuff by reset().

    Here is the code
    PHP Code:
                                addEscListener: function() {
                                    if (!
    this.clearOnEscape) return;
                                    
    this.textField.inputEl.on('keydown', function(e) {
                                        if (
    e.getKey() == Ext.EventObject.ESC) {
                                            if (
    this.textField.isExpanded) return;
                                            
    Ext.Function.defer(this.textField.reset1this.textField);
                                            
    e.stopEvent();
                                        }
                                    }, 
    this);
                                },
                                
    handleMouseClickOnClearButton: function(eventhtmlElementobject) {
                                    if (!
    this.isLeftButton(event)) return;
                                    
    this.textField.reset();
                                    
    this.textField.focus();
                                } 
    Regards,

    Leonardo

  10. #20
    Ext JS Premium Member
    Join Date
    Dec 2007
    Posts
    38

    Default

    nice plugin but i've same trouble with combobox.

    Because reset is not the same as clear value, I do this :
    Code:
    init : function(textField) {
        this.textField = textField;
        this.textField.addEvents('clear');
        if (!textField.rendered) {
            textField.on('afterrender', this.handleAfterRender, this);
        } else {
            // probably an existing input element transformed to extjs field
            this.handleAfterRender();
        }
    },
    addEscListener: function() {
        if (!this.clearOnEscape) return;
        this.textField.inputEl.on('keydown', function(e) {
        if (e.getKey() == Ext.EventObject.ESC) {
            if (this.textField.isExpanded) return;
            Ext.Function.defer(this.clearValue, 1, this);
            e.stopEvent();
        }
        }, this);
    },
    handleMouseClickOnClearButton: function(event, htmlElement, object) {
        if (!this.isLeftButton(event)) return;
        this.clearValue();
        this.textField.focus();
    },
    clearValue : function() {
        if (Ext.isFunction(this.textField.clearValue)) {
            this.textField.clearValue();
        } else {
            this.textField.setValue('');
        }
        this.textField.fireEvent('clear', this.textField);
    }

Page 2 of 8 FirstFirst 1234 ... LastLast

Similar Threads

  1. [OPEN] [OPEN-726] bad clear icon handling when Text field is in a toolbar
    By jep in forum Sencha Touch 1.x: Bugs
    Replies: 5
    Last Post: 29 Aug 2011, 9:43 AM
  2. Ext.form.Field override : Adding an icon to a form field of any type
    By arnold in forum Ext 2.x: User Extensions and Plugins
    Replies: 2
    Last Post: 25 Mar 2011, 6:41 AM
  3. Replies: 1
    Last Post: 5 Jul 2010, 4:13 AM
  4. Feature suggestion: Ext.form.Field.clear
    By dyndan in forum Community Discussion
    Replies: 2
    Last Post: 28 Feb 2008, 4:01 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
  •