PDA

View Full Version : Help for application



ubeddu
28 Oct 2009, 2:46 AM
Hi guys, I have to implement an application consists of a toolbar to the north and a panel in the center. On the toolbar there is a button "search", just click on this button should open a window containing a form with fields name and a button accepts, just press the button accepts the data must shine in panel.Come should I do ? Thanks
can post examples because I'm a newbie

28 Oct 2009, 4:54 AM
I'm sorry, but I doubt anyone is going to develop this application for you

28 Oct 2009, 4:55 AM
There are examples, you'll need to learn the framework. If everyone did your homework for you at school, you would know nothing.

ubeddu
28 Oct 2009, 5:06 AM
Ok, where can I find examples to implement a window containing a form?
thanks

28 Oct 2009, 5:08 AM
have you looked at the Ext js online examples?

ubeddu
28 Oct 2009, 5:12 AM
Yes, but what I do not understand is how to return the values in the form..

28 Oct 2009, 5:15 AM
look at the methods exposed (public) in the API.

ubeddu
29 Oct 2009, 1:04 AM
Hello, I created this window, but I can not save and retrieve the file save-form.php, what's wrong with the code that I wrote? thanks

<html>
<head>
<title >PRGIS WebTree Attributi</title>
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
</head>
<script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();



var win = new Ext.Window({
//url: 'save-form.php',
title: 'Clienti',
renderTo:Ext.getBody(),
iconCls:'icon-bulb',
width:650,
height:415,
border:false,
layout:'fit',
items:[{

xtype:'form',
url: 'save-form.php',
method:'post',
standardSubmit: true,
frame:true,
items:[{
xtype: 'textfield',
fieldLabel: 'name',
name: 'name'
},{
xtype: 'textfield',
fieldLabel: 'surname',
name: 'surname',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'address',
name: 'address'
},{
// column layout with 2 columns
layout:'column',

// defaults for columns
defaults:{
columnWidth:0.5,
layout:'form',
border:false,
xtype:'panel',
bodyStyle:'padding:0 18px 0 0'
},
items:[{
// left column
// defaults for fields
defaults:{anchor:'100%'},
items:[{
xtype: 'label',
fieldLabel: 'field1',
name: 'field1'
},{
xtype: 'textfield',
fieldLabel: 'field2',
name: 'field2',
allowBlank: false,
},{
xtype: 'textfield',
fieldLabel: 'field3',
name: 'field3'
},{
xtype: 'textfield',
fieldLabel: 'Email',
name: 'email',
vtype: 'email'
}]
},{
// right column
// defaults for fields
defaults:{anchor:'100%'},
items:[{
xtype: 'label',
fieldLabel: 'address_2',
name: 'address_2'
},{
xtype: 'textfield',
fieldLabel: 'name_2',
name: 'name_2'
},{
xtype: 'textfield',
fieldLabel: 'telephone',
name: 'acc_telephone'
},{
xtype: 'textfield',
fieldLabel: 'Email',
name: 'email_1',
vtype: 'email'
}],
buttons: [{
text: 'Submit',
handler: function(){

this.ownerCt.ownerCt.getForm().submit({
success: function(f, a){
Ext.Msg.alert('OK', 'Submit Ok');
},
failure: function(f, a){
Ext.Msg.alert('No', "Submit no Ok " + a.result.erromsg);
}
})
}
}]
}]
}]
}]
});
win.show();
});

</script>


<body>
</body>
</html>