Reputation: 1073
Which event fires after form load? My requirement is at the time of view load based on some condation some controls set to disable mode(read only)
so how to handle this (which event)
i have try this formpanel.on({ actioncomplete: function (form, action) {}
but ist not fired
thanks in advance
Upvotes: 1
Views: 6937
Reputation: 942
I just struggled with this today. The important thing to keep in mind is that there is no event fired on form.loadRecord()
as it is simply a setValues()
wrapper. If you want an event to be fired on loadRecord()
, you will need to define it yourself by extending Ext.form.Basic
(and potentially adding the event to relayEvents in Ext.form.Panel
).
Upvotes: 5
Reputation: 48236
You can observe the events on an Observable using Ext.util.Observable.capture. Here is an example of observing a form, which is loaded and then submitted:
http://jsfiddle.net/el_chief/HBah5/4/
I saw these events:
fieldvaliditychange
fielderrorchange
validitychange
dirtychange
beforeaction (i hit submit)
afterlayout
actionfailed (it did not submit to anywhere)
Don't forget, BasicForm has its own events (though I believe they are all relayed to Form), as do Fields inside a form.
Changing basic.trackResetOnLoad changes some of the events too, in particular "dirtychange"
Upvotes: 0
Reputation: 23975
I assume you a event after a record/data has loaded into the form. The action get handled in the basicForm
and calls. Within the basicForm
the load()
calls doAction()
so you should be able to use the following events from the basicForm
actioncomplete : ( Form this, Action action ) Fires when an action is completed.
actionfailed : ( Form this, Action action ) Fires when an action fails.
beforeaction : ( Form this, Action action ) Fires before any action is performed. Return false to cancel the action.
Upvotes: 4