Hi there!...
I have a grid with multiple rows. When I select a row and then press an Edit button, a small dialog window appears. Inside that dialog I have a dynamic form, the fields of that form are filled with some server-side data. That works for the first time, but when I select another row and I push the edit button, the data of the window is unchanged, because there was no other call to the server.
Here is the code I use :
editDg = new Ext.LayoutDialog("page-edit-dlg", {
modal:false,
width:700,
height:380,
shadow:true,
minWidth:300,
minHeight:200,
proxyDrag: false,
center: {
autoScroll:true,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: true
}
});
editDg.addKeyListener(27, editDg.hide, editDg);
editDg.addButton('Save', editDg.hide, editDg);
editDg.addButton('Cancel', editDg.hide, editDg);
var layout = editDg.getLayout();
layout.beginUpdate();
var CenterPanel = Ext.DomHelper.append(document.body, {tag:'div ', cls:'CenterPanel'}, true);
layout.add('center', new Ext.ContentPanel(CenterPanel, { title:'Content', autoScroll:true, fitContainer:true, fitToFrame:true}));
updater = CenterPanel.getUpdateManager();
updater.disableCaching = false;
updater.update({url: '/admin/contents/edit/' + id + '/', scripts:true, nocache: true, discardUrl:true});
updater.on("beforeupdate", function (object){console.log('beforeupdate');}, this, true); /branches/scam-nimble-spindeln/src/webapp/ext/docs/output/Ext :: Panel.html#renderTo">renderTo</a> will be ignored and the target element's parent node will automatically be used as the panel's container. </div> http://project.iml.umu.se/projects/scam-nimble/browser/branches/scam-nimble-spindeln/src/webapp/ext/docs/output/Ext.Panel.html?rev=881HOME |
updater.on("update", function (object){console.log('update');}, this, true);
// generate some other tabs
layout.add('center', new Ext.ContentPanel(Ext.id(), {autoCreate:true, title: 'Charts', background:true}, 'charts to be displayed!'));
layout.endUpdate();
What FireBug is saying:
- a first call to the server as "GET http://localhost/myproject/admin/contents/edit/22/?_dc=1177484923875 (234ms)"
- only "update" is logged
- on second row selected, updater.update() is never called, although I have "discardUrl: true", so the content remains the same, which is wrong.
It should make a second call to the server, right?...And why "beforeupdate" event is not logging?...
I'm using the latest release of Ext-1.0, downloaded today. Changeset 18961 - Project.net Community Development - Trac:: Changeset 18961. View differences. inline, side by side. Show lines around each change. Ignore: Blank lines. Case changes. White space changes http://community.project.net/trac/pnet-community/changeset/18961HOME | Gmane -- Mail To News And Back Again:: Home Reading Searching Subscribe Sponsors Statistics Posting Contact Spam Lists Links About Hosting Filtering Features Download Marketing Archives http://article.gmane.org/gmane.comp.web.zope.opencore.scm/12195HOME |
And yes...ExtJS is a great piece of art...
How are you calling update the 2nd time? What parms are you passing? Did you verify that you're even getting to updatemanager.update()? Use firebug to step thru your code. The first thing it does is fire beforeupdate, so if you're not logging that, I would suspect you never really call update. You're not creating the dialog and layout every time are you?
As I later understood, it was a false problem.
The events "beforeupdate" and "update" are fired, and the dialog window is created only once.
When I select another row and try to edit it, the same dialog window appears, so the content remains the same.
It's nothing buggy with the ExtJS at this moment, but a badly design of my app and I will have to rethink it... :">
My problem now is to find a way to refresh the content of that dialog every time I push a button. Or to give up on dialog and create a new region instead to show up the edit form.
Thanx for your time!...You can delete this post or close it by now.
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|