PDA

View Full Version : how can close the windows ?



ebinaini
23 Nov 2007, 10:56 AM
hi everyone !
i get a problem that i can't close the windows


function getfrom(select){


var from = new Ext.FormPanel({
labelWidth: 75,
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: '编号',
name: 'saleid',
allowBlank:false,
value:select.data.id
},{
fieldLabel: '名称',
name: 'name',
value:select.data.name
},{
fieldLabel: '价格',
name: 'price',
value:select.data.price
}, {
fieldLabel: '类型',
name: 'type',
value:select.data.pk_tree

}, {
fieldLabel: '数量',
name: 'number',
value:select.data.number

}, {
fieldLabel: '进货',
name: 'address',
value:select.data.pk_factroy

}, {
fieldLabel: '出售时间',
name: 'date',
value: dt.format('y-m-d'),
xtype:'datefield'
}
],

buttons: [{
text: '出售',
handler:function(){
from.form.doAction('submit',{
url:'shop.shtml?option=saleproduct' (http://extjs.com/forum/'shop.shtml?option=saleproduct'),
method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert('操作',action.result.data);
from.disabled=false;
},
failure:function(){
Ext.Msg.alert('操作','保存失败!');
from.disabled=false;
}
});
}
},
{
text: '取消',
handler:function(){sale.hide()}
}]
})
return from;
}
function creatDilag(){
var select = grid.getSelectionModel().getSelected();
sale = new Ext.Window({
el:'sale-win',
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
items: getfrom(select)

});

sale.show();
}
grid.on('rowdblclick', creatDilag);

efege
23 Nov 2007, 11:06 AM
Please, can you edit your post and wrap the code using [CODE] tags? Thanks!