Results 1 to 8 of 8

Thread: simple TriggerField() example?

  1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    99
    Vote Rating
    0
      0  

    Default simple TriggerField() example?

    can someone point me in the direction of a simple TriggerField() example. i'd like to have a search field with the little magnifying glass button as in this example...

    http://extjs.com/deploy/dev/examples/form/custom.html

    but the included SearchField.js is far more than i need...and the code is a bit over my head

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,436
    Vote Rating
    859
      0  

    Default

    It's only a few lines, which bits don't you understand?

  3. #3
    Ext User
    Join Date
    Aug 2007
    Posts
    99
    Vote Rating
    0
      0  

    Default

    well, it looks like it's trying to extend another class? isn't there a simple way to do an inline TriggerField()? Same as you would for a comboBox() or TextField()?

  4. #4
    Ext User
    Join Date
    Jan 2008
    Posts
    85
    Vote Rating
    1
      0  

    Default

    If you mean you just want the magnifying glass then just change the triggerClass to x-form-search-trigger.

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      1  

    Default

    Example:

    Code:
    var triggerField = new Ext.form.TriggerField({
    	'fieldLabel': 'Search',
    	'triggerClass': 'x-form-search-trigger',
    	'onTriggerClick': function() {
    		// perform search
    	}
    });

  6. #6
    Ext User
    Join Date
    Aug 2007
    Posts
    99
    Vote Rating
    0
      0  

    Default

    That's exactly what i was looking for, thanks again Condor!

  7. #7
    Ext Premium Member
    Join Date
    Mar 2010
    Posts
    42
    Vote Rating
    0
      0  

    Default

    How can i get the value entered in the text field?

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    Code:
    onTriggerClick: function() {
      var value = this.getValue();
      ...
    }

Posting Permissions

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