dax
4 Oct 2007, 8:20 AM
Hi!!!
I'm triying to display a form in a dialog window and I get a design error I think and I can't to see my form.
I put the html code :
<div id="capa_form" name="capa_form" style="width:600px;" class="x-form">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Multi-column and labels top</h3>
<div id="form-ct2">
</div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
And the js code :
var obrirForm = function(){
var dialog;
return {
show: function(){
if(!dialog){
dialog = new Ext.BasicDialog("capa_form", {
autoTabs: false,
width: 500,
height: 300,
shadow: true,
minWidth: 500,
collapsible: false,
modal: false,
minHeight: 300,
proxyDrag: false
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('Aceptar', dialog.hide, dialog);
}
dialog.show();
}
};
var top = new Ext.form.Form({
labelAlign: 'top'
});
top.column(
{width:282}, // precise column sizes or percentages or straight CSS
new Ext.form.TextField({
fieldLabel: 'First Name',
name: 'first',
width:225
}),
new Ext.form.TextField({
fieldLabel: 'Company',
name: 'company',
width:225
})
);
top.column(
{width:272, style:'margin-left:10px', clear:true}, // apply custom css, clear:true means it is the last column
new Ext.form.TextField({
fieldLabel: 'Last Name',
name: 'last',
width:225
}),
new Ext.form.TextField({
fieldLabel: 'Email',
name: 'email',
vtype:'email',
width:225
})
);
top.container({},
new Ext.form.HtmlEditor({
id:'bio',
fieldLabel:'Biography',
width:550,
height:200
})
);
top.addButton('Save');
top.addButton('Cancel');
top.render('form-ct2');
}();
Ext.onReady(function(){
var tb = new Ext.Toolbar('barra_menu', [{
text : 'Archivo',
menu : {
id : 'MenuBasico',
items :
[{
text : 'Ventana',
handler : function(){ finestra.show(); }
}, {
text : 'Modal',
handler : function(){ modal.show(); }
},
'-',
{
text : 'Formulario',
icon : 'list-items.gif',
handler : function(){ obrirForm.show(); }
}]
}
}]);
});
I hope you can understand me.
Bye.
I'm triying to display a form in a dialog window and I get a design error I think and I can't to see my form.
I put the html code :
<div id="capa_form" name="capa_form" style="width:600px;" class="x-form">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Multi-column and labels top</h3>
<div id="form-ct2">
</div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
And the js code :
var obrirForm = function(){
var dialog;
return {
show: function(){
if(!dialog){
dialog = new Ext.BasicDialog("capa_form", {
autoTabs: false,
width: 500,
height: 300,
shadow: true,
minWidth: 500,
collapsible: false,
modal: false,
minHeight: 300,
proxyDrag: false
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('Aceptar', dialog.hide, dialog);
}
dialog.show();
}
};
var top = new Ext.form.Form({
labelAlign: 'top'
});
top.column(
{width:282}, // precise column sizes or percentages or straight CSS
new Ext.form.TextField({
fieldLabel: 'First Name',
name: 'first',
width:225
}),
new Ext.form.TextField({
fieldLabel: 'Company',
name: 'company',
width:225
})
);
top.column(
{width:272, style:'margin-left:10px', clear:true}, // apply custom css, clear:true means it is the last column
new Ext.form.TextField({
fieldLabel: 'Last Name',
name: 'last',
width:225
}),
new Ext.form.TextField({
fieldLabel: 'Email',
name: 'email',
vtype:'email',
width:225
})
);
top.container({},
new Ext.form.HtmlEditor({
id:'bio',
fieldLabel:'Biography',
width:550,
height:200
})
);
top.addButton('Save');
top.addButton('Cancel');
top.render('form-ct2');
}();
Ext.onReady(function(){
var tb = new Ext.Toolbar('barra_menu', [{
text : 'Archivo',
menu : {
id : 'MenuBasico',
items :
[{
text : 'Ventana',
handler : function(){ finestra.show(); }
}, {
text : 'Modal',
handler : function(){ modal.show(); }
},
'-',
{
text : 'Formulario',
icon : 'list-items.gif',
handler : function(){ obrirForm.show(); }
}]
}
}]);
});
I hope you can understand me.
Bye.