Hybrid View

  1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    99
    Vote Rating
    0
    bcamp1973 is on a distinguished road

      0  

    Default simple TriggerField() example?

    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
    17,064
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      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
    bcamp1973 is on a distinguished road

      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
    0
    jonn is on a distinguished road

      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
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    bcamp1973 is on a distinguished road

      0  

    Default


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