18 Jan 2008 6:33 AM #1
I just added a small window extension that will add Ok and Cancel buttons to your window, and adds some standard behaviour to these buttons.
It's also possible to add only a Close butten instead of the Ok and Cancel buttons.
The plus of this is that you do not have to retype these things for every window.
Small as the extension is, IMHO it also shows how to build extensions and how to use the event handlers.
Any comments, improvements and opinions are welcome as always.
I've added some functionality and updated the page to v0.91. There's one addition I still want to make before reaching v1.0, and that is to be able to add a Select button, which will return the selected record(s) from a grid in the window. I hope to do this soon.
Last edited by Ronaldo; 22 Jan 2008 at 11:20 PM. Reason: new version
19 Jan 2008 2:10 PM #2
Nice! Two extra requests:
- the submit params should be configurable..
- add an afterClose(bool success) event..
20 Jan 2008 2:56 AM #3
Thanks for your reply. I was thinking about the same functionality that you mentioned. As all my windows are separate objects, I 'initialize' the url for example in the window, cause I feel that a window has one url it should fetch all data from and save all data to.
But it should be confurable, yes, as should be the params to send with the request.
But what do you intent with the success boolean in the 'afterClose' event? I'd think that a listener can prevent closing, submitting or canceling a window by returning false. But after the this.win.close() statement, the window is always closed I'd think.
Or do you mean to pass a boolean whether or not the window is successfully submitted?
20 Jan 2008 12:38 PM #4
21 Jan 2008 1:33 AM #5
I've updated the source more or less as you asked me. There's one more thing I want to add, I'll hope to do that later on.
This morning I couln't post the new version on the wiki, as it didn't allow me to make changes to the text. I asked the ext team to update the source for me or to tell me what the error means.
I want to add another 'Select' button, which can be used together with the Close button. It's meant to return one or more selected records if the window contains a grid. This will open up the possibility of using a lookup control which will open a window and will enable the user to select a record.
21 Jan 2008 2:18 AM #6
- Join Date
- Mar 2007
- The Netherlands
- Vote Rating
Your default onCancel and onClose handlers don't support closeAction:'hide'.
21 Jan 2008 3:20 AM #7
Thanks, I'll change that.