GIGJ.COM
welcome to my space
X
Search:  
Welcome to:gigj.com
NAVIGATION: Home >>

Strange Form Behavior in Ext Window

Published by: cfz 2009-01-07

Let me begin by saying that I am relatively new to the Ext world. SO I apologize in advance if I've missed something obvious...

I am working with the Border Layout Example. In the East panel, within a tab I have created a Grid that is populated via a Coldfusion/JSON call. The grid contains a rowselect listener which, when clicked, fires the following series of events:

1. A new form is created
2. Buttons are added to the form
3. A new window is created
4. The window is shown
5. The form is populated (loaded)

Here is my code:

clientgrid.getSelectionModel().addListener("rowselect", function(sm, row, record) {
//Client Details Form
var clientForm = new Ext.FormPanel({
labelWidth: 80,
labelAlign: 'top',
bodyStyle: 'padding: 15px',
defaultType: 'textfield',
baseCls: 'x-plain',
waitMsgTarget: true,
baseParams:{},
items: [
{
name: 'sessID',
hidden:true,
hideLabel:true
},
{
fieldLabel: 'Company',
width:250,
name: 'COMPANY',
allowBlank: false,
blankText: 'Please enter a company name.',
maxlength: 50,
msgTarget: 'under'
},
{
fieldLabel: 'Address',
width:250,
name: 'ADDRESS1'
},
{
fieldLabel: '',
hideLabel: true,
width:250,
name: 'ADDRESS2'
}
]
});
clientForm.addButton({
text: 'Save Changes',

[#AMQNET-87] CLONE -Strange Disconnect issues with .Net and VS2005 ::
May 21, 2008 I'll show this in step form below. Thanks for your assistance! after clicking "stop" and "start" again, you'll see normal behavior.
http://issues.apache.org/activemq/browse/AMQNET-87;jsessionid=B17B0878D1A32DAC278E144E4F1F3BDE?page=com.atlassian.jira.ext.fisheye:fisheye-issuepanel
HOME
handler: function(){
clientForm.form.submit({
url:'fClientData.cfm' (http://extjs.com/forum/'fClientData.cfm'),
waitMsg:'Saving Data...',
success: function (form, action) {
Ext.MessageBox.alert('Message', 'Saved OK');
},
failure:function(form, action) {
Ext.MessageBox.alert('Message', 'Save failed');
}
});
}
});
clientForm.addButton({
text: 'Reset',
type: 'reset',
handler: function() {
clientForm.form.load({
url: 'appProxy.cfc',
method:'GET',
waitMsg:'Loading...'
});
}
});
var clientWin = new Ext.Window({
title:"Client Details",
width:800,
height:600,
items: clientForm,
modal:true,
autoScroll:true,
closeAction:"close"
});
// Set the parameters to pass to the appProxy.cfc
var clientID = record.id;
Ext.apply(clientForm.form.baseParams,{method:'clie ntFormData', clientID: clientID});
// Show the window
clientWin.show();
// Get the form data and load it to the form
clientForm.form.load({
url: 'appProxy.cfc',
method:'GET',
waitMsg:'Loading...'
});
});

When a row is selected (clicked) from the grid for the first time everything works as expected with one exception - the window is not the size as defined by its height and width attributes - it is smaller.
Extension Developing - Fireworks and general Web Designers Zone ::
What's So Advance about Advance Open Window? PureASPUpload 2.09 Error · javascript behaviour extension needed · Smart Image Processor Issues
http://www.fwzone.net/forum/link/?163
HOME

Here's where it gets strange - for me at least!

After the first time the window has been opened, I close the window (via the X in the upper right corner); and, because my closeAction is set to 'Close', I assume that the window and its contents are being destroyed.

Now I click on a row from the grid a SECOND time and the series of events outlined above fire once again as expected, except that the form's buttons now are set below the bottom of the window; forcing the window to auto scroll. The good thing is that now the window is the correct size!

Finally, after closing the window for the second time I can now reopen it indefinitely and it is laid out and sized exactly as expected.

In my earlier attempt at this I was creating the form outside of my listener and hiding, not closing, the window. However, subsequent calls to show the window would briefly show the last data set until the new data was loaded - which I didn't want.

Thanks in advance for anyone's help, comments, criticisms!

__________________________________________________ __________________________________________________ ___


Update:

In an effort to simplify my troubleshooting I replaced my form code with the simple form example and removed and data load.

Here is the updated source:

clientgrid.getSelectionModel().addListener("rowselect", function(sm, row, record) {
var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php' (http://extjs.com/forum/'save-form.php'),
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',

items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}, new Ext.form.TimeField({
fieldLabel: 'Time',
name: 'time',
minValue: '8:00am',
maxValue: '6:00pm'
})
],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});

var clientWin = new Ext.Window({
layout: "form",
title:"Client Details",
width:800,
height:600,
modal:true,
autoScroll:true,
closeAction:"close",
items: simple
});

clientWin.show();
});

Here is the behavior for each of 3 clicks:

1st Click

http://www.letternine.net/images/1.gif

2nd Click:

http://www.letternine.net/images/2.gif

3rd Click:

http://www.letternine.net/images/3.gif

So, the second time and every other time after the third time I open the above window the form is laid out as it's supposed to be.

Lost...


Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks

PRINT Add to favorites
  • dear god i hope they are kidding
  • supercell sketch or graphic
  • what the
  • incredible 30cm rime
  • ams statement freedom of scientific expression
  • grey hound chasing a new era
  • breaking news the end of an era dedicated manned wx obs
  • looking for 3 13 90 data
  • oddball question
  • possible march chase chance for sp
  • february jetstreams affecting airline performance
  • using forecast ensembles for long term chase planning
  • hurricane pinhole eyes
  • strange gel like goo precipitating from clouds in northwest

  • made an extreme wind chase with gusts over 110mph yesterday
  • rain returns to southern california
  • climate change paper
  • powerpoint material for wx talk
  • vertical or horizontal
  • another question concerning climate change
  • casual observation and question re vil
  • nwsfos and chasers spotters
  • hailstone structure
  • chaser safety and responsibility suggestions
  • nws ridge radar display now available nationwide
  • tapes from the denver convention
  • chat dr greg forbes monday february 27 8 pm est 7 pm cst
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Strange Form Behavior in Ext Window , Please add it free.
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 gigj.com        Site made:CFZ