Pro paintball - Shop sales, stores & prices at TheFind.com:: Features and Benefits Gun Action: Semi -Automatic - -Allows you to shoot as fast as you can pull the trigger. Field Maintenance: Strips without Special http://www.thefind.com/sports/info-pro-paintballHOME | is it possible to declare a listener in a TriggerField 2.0 in the usual 2.0 way?
something like
{
xtype:'trigger',
fieldLabel: 'Account',
id:'trig-funnelpos' ,
name: 'ActionCustomer' ,
listeners: {triggerclick:triggerclickfn}
...
}
I tried it (not with this code that is an example) but it don't work.
thank you
It looks like triggerclick is not defined as an event you can handle. However, onTriggerClick is a empty fn that you can override to what you need.
{
xtype:'trigger',
fieldLabel: 'Account', Oracle's Cooperative Development Environment: A Reference and - Google Books Result:: href=http://books.google.com/books?id=JVDgTdPBvm4C&pg=PA230&lpg=PA230&dq=TriggerField&source=bl&ots=NUiWHyL_J_&sig=9ut5Y_d1uTkwjiLKzcgPvZ1ohcA&hl=en&sa=X&oi=book_result&resnum=75&ct=result class=l onmousedown=return clk(this.href,,,res,94,)>Oracle's Cooperative Development Environment: A Reference and - Google Books Resultby Kevin E. Kline - 1995 - Computers - 366 pagesFormat triggers are created in the Format Trigger field of the appropriate layout object's property sheet. VALIDATION TRIGGERS Validation triggers test the http://books.google.com/books?id=JVDgTdPBvm4C&pg=PA230&lpg=PA230&dq=TriggerField&source=bl&ots=NUiWHyL_J_&sig=9ut5Y_d1uTkwjiLKzcgPvZ1ohcA&hl=en&sa=X&oi=book_result&resnum=75&ct=resultHOME |
id:'trig-funnelpos' ,
name: 'ActionCustomer' ,
onTriggerClick: myTriggerFn
...
}
The reason it's done this way is because there is no default implementation for a trigger click, so the onTriggerClick function is the implementation. With other components, events are used in addition to whatever the implemented action is to let you know that something happened -- in this case, nothing technically happens without an implementation. There are many examples of onXXX functions used throughout Ext for the same reason. arXiv:hep-ph/9911447v2 5 Jun 2000:: File Format: PDF/Adobe Acrobat - View as HTMLtransition, the second trigger field, the one ending inflation, stage only, and then performing damped oscillations; finally, the trigger field http://arxiv.org/pdf/hep-ph/9911447.pdfHOME |
You should override onTriggerClick as Tim suggested above.
http://extjs.com/deploy/dev/docs/?class=Ext.form.TriggerField
Most typical use cases are not going to use a triggerfield directly but rather extend triggerfield into a new field type and register this new field type with the component manager. For a brief example:
Ext.namespace('Ext.ux');
Ext.ux.AccountPickerField = Ext.extend(Ext.form.TriggerField, {
width: 400,
defaultAutoCreate: {
tag: "textarea",
style:"width:100px;height:" + this.height 180 + "px;",
autocomplete: "off",
html: 'None Selected'
},
onTriggerClick: function(e) {
// Custom implementation of onTriggerClick
}
});
Ext.reg('accountpickerfield', Ext.ux.AccountPickerField);
We can now use our imaginary AccountPickerField in a form definition like so:
{
xtype:'accountpickerfield',
fieldLabel: 'Account',
id:'trig-funnelpos' ,
name: 'ActionCustomer'
...
}
Now you have a re-usable component which you can use in different forms and can avoid code duplication. Note that all xtypes are all lowercase.
Thanks, Brian, that makes sense. It's a good thing to be watchful for when trying to develop best practices for working with the library.
It looks like triggerclick is not defined as an event you can handle. However, onTriggerClick is a empty fn that you can override to what you need.
{
xtype:'trigger',
fieldLabel: 'Account',
id:'trig-funnelpos' ,
name: 'ActionCustomer' ,
onTriggerClick: myTriggerFn
...
}
I was just working with this as well, and discovered this same issue. This seems inconsistent with the way the rest of the API works -- perhaps a candidate to refactor to conform?
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|