Troy Wolf
7 Sep 2007, 7:55 AM
Before I sound like I'm complaining, let me say that Ext is wonderful. The documentation is very good and even the documentation viewer is beautiful.
I have to admit (as I have in a few other threads), I'm struggling with Ext. I'm making progress, but I'm struggling. Let's just say "Extra-Strength Excedrin" has been my study partner.
Right now I am beating my brain trying to figure out how to process the JSON returned by my server on an Ext form submit. (I don't even know how to access it.) But let's forget about that for now....let's take a step back and look at a larger, more basic issue...
So I look at code like this:
frmTweak.addButton('Apply', function() {
if (frmTweak.isValid()) {
frmTweak.submit({
params:{action:'Tweak'},
waitMsg:'Processing data, please wait...',
reset:false,
scope:frmTweak,
success: function() {alert('success');}
});
} else {
Ext.MessageBox.alert("Warning", "Please correct missing or invalid fields.");
}
});
I can see that an Ext Form named frmTweak has been created (not in this snippet). I can see that if the form isValid(), we'll call the form's submit() method. I can see that the submit method takes an options object. I can see that one of the options is "success". I want to know more about this option...
So off to the docs I go. I start by going to the Form docs:
http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html
I scroll down and find the submit() method. I click it:
http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html#submit
This only confirms that yes, the submit method does accept an options object. It tells me nothing about those options. It does, however, direct me to the doAction() function:
http://extjs.com/deploy/ext/docs/output/Ext.form.BasicForm.html#doAction
The doAction documentation tells me nothing about an option named "success".
This is one specific scenario, but this happens to me often. It may be easy for me to give up with "this Ext documentation is not very good", but I know enough to know I don't know enough! ;) The documentation is probably fantastic, but I need a primer in how to find what I'm looking for.
My suspicion is that the submit action (or the form) is inheriting from (or extending?) some more basic object that defines the success option. But when top-down learning from code examples, how would or could I know that?
I am ready to be schooled (or shamed as it may be).
I have to admit (as I have in a few other threads), I'm struggling with Ext. I'm making progress, but I'm struggling. Let's just say "Extra-Strength Excedrin" has been my study partner.
Right now I am beating my brain trying to figure out how to process the JSON returned by my server on an Ext form submit. (I don't even know how to access it.) But let's forget about that for now....let's take a step back and look at a larger, more basic issue...
So I look at code like this:
frmTweak.addButton('Apply', function() {
if (frmTweak.isValid()) {
frmTweak.submit({
params:{action:'Tweak'},
waitMsg:'Processing data, please wait...',
reset:false,
scope:frmTweak,
success: function() {alert('success');}
});
} else {
Ext.MessageBox.alert("Warning", "Please correct missing or invalid fields.");
}
});
I can see that an Ext Form named frmTweak has been created (not in this snippet). I can see that if the form isValid(), we'll call the form's submit() method. I can see that the submit method takes an options object. I can see that one of the options is "success". I want to know more about this option...
So off to the docs I go. I start by going to the Form docs:
http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html
I scroll down and find the submit() method. I click it:
http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html#submit
This only confirms that yes, the submit method does accept an options object. It tells me nothing about those options. It does, however, direct me to the doAction() function:
http://extjs.com/deploy/ext/docs/output/Ext.form.BasicForm.html#doAction
The doAction documentation tells me nothing about an option named "success".
This is one specific scenario, but this happens to me often. It may be easy for me to give up with "this Ext documentation is not very good", but I know enough to know I don't know enough! ;) The documentation is probably fantastic, but I need a primer in how to find what I'm looking for.
My suspicion is that the submit action (or the form) is inheriting from (or extending?) some more basic object that defines the success option. But when top-down learning from code examples, how would or could I know that?
I am ready to be schooled (or shamed as it may be).