日期:2014-05-17 浏览次数:20923 次
function LoadForm(baseUrl)
{
var fpProductSearch = new Ext.FormPanel({
renderTo: 'searchDiv',
id:"fpProductSearch",
labelWidth: 75,
frame:true,
title: '产品搜索',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: '产品名称',
emptyText:'B-5538(YAS023400)',
name: 'product.productname'
}],
buttons: [{
id:"btnSearch",
text: '查找',
handler: function(){
var baseParams = fpProductSearch.form.getValues();
fpProduct.getForm().reset();
Ext.Ajax.request({
url : baseUrl + '/productAction!SearchProduct',
method:"post",
params: baseParams,
success: function (response,options) {
obj = Ext.decode(response.responseText);
if(obj.success)
{
fpProduct.getForm().setValues(obj.message);
}else
{
Ext.Msg.alert('错误', obj.message);
}
},
failure: function(response,options) {
Ext.Msg.alert('错误', response.statusText);
}
});
}
},{
id:"btnSReset",
text: '清空',
handler: function(){
fpProductSearch.getForm().reset();
}
}]
});
var fpProduct = new Ext.FormPanel({
renderTo: 'resultDiv',
labelAlign: 'top',
frame:true,
title: '产品信息编辑',
bodyStyle:'padding:5px 5px 0',
width: 960,
items: [{
layout:'column',
items:[{
columnWidth:.25,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: '产品名称',
name: 'productname',
anchor:'95%'
}, {
xtype:'textfield',
fieldLabel: '创建人',
name: 'creator',
anchor:'95%'
}
, {
xtype:'textfield',
fieldLabel: '客户',
name: 'customeruid',
anchor:'95%'
}
, {
xtype:'textfield',
fieldLabel: '拼板数量',
name: 'panelnum',
anchor:'95%'
}
, {
xtype:'textfield',
fieldLabel: '备注',
name: 'description',
anchor:'95%'
}]
},{
columnWidth:.25,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: '物料号',
name: 'productpartnumber',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: '创建时间',
name: 'createDateStr',