PDA

View Full Version : Form in read mode


becomcs
09-06-2007, 04:52 AM
Sample Form provided in a2r1 don't look for edit mode

I tried the following code

myApp.frm = new Ext.nd.Form();

if ( Ext.nd.UIDocument.EditMode )
{
// Specific fields initialisation
myApp.initEdit();
myApp.frm.render();
} else
{
myApp.frm.buildLayout();
}


And it seems to works fine.

Could you confirm convertFields() contains in frm.render is'nt usefull in readmode.

RWaters
09-07-2007, 10:40 AM
I'm pretty confident that it isn't useful in read mode. :P

Good catch.

jratcliff
09-07-2007, 10:40 PM
Well, I guess we could add a check for edit mode but the way it works now shouldn't matter since the code loops through form.elements and since you are in read mode, there won't be "domino generated" form fields.

However, what if you wanted to add some pass-thru html in order to include some form fields when in read mode? What should we do there? The way it works now, the code will convert those fields into Ext form fields automatically. Wouldn't this be desirable?

becomcs
09-10-2007, 05:42 AM
This issue is linked to <FIELDSET> issue (http://extjs.com/forum/showthread.php?t=12348)

Furthermore if you use non extnd pass-thru html code, it will be processed twice.

This explain why I add
myApp.initEdit();

A class tag (e.g., "extnd-ignore") could be usefull to specify to Ext.nd.Form render methode to ignore concerned form items. Is'nt it?