首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

急Extjs 表单填充有关问题

2012-03-19 
急!Extjs 表单填充问题 - Web 开发 / AjaxExt.onReady(function(){Ext.QuickTips.init()// turn on valid

急!Extjs 表单填充问题 - Web 开发 / Ajax
Ext.onReady(function(){

Ext.QuickTips.init();

// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
var fs = new Ext.FormPanel({
frame: true,
title:'jsomn Form',
labelAlign: 'right',
labelWidth: 85,
width:340,
waitMsgTarget: true,

// configure how to read the json Data
reader : new Ext.data.JsonReader({
success: 'success',
record : 'data'
}, [
{name: 'name', mapping:'name'}, // custom mapping
{name: 'sex', mapping:'sex'}
]),

items: [
new Ext.form.FieldSet({
title: 'Contact Information',
autoHeight: true,
defaultType: 'textfield',
items: [{
fieldLabel: 'sex',
name: 'name',
width:190
},{ 
fieldLabel: 'sex',
name: 'sex',
width:190
}
]
})
]
});
fs.form.load({url: 'resForm.jsp',method:'GET', waitMsg:'Loading' });

});
resForm.jsp代码:
<%out.print("{success:true,data:[{name:'Rooney',address:'Mu',loves:2,memo:'Tank'}]}");
%>
现在显示不出来 急求解决办法,或者给个例子

[解决办法]
这个是官方的例子

JScript code
var myFormPanel = new Ext.form.FormPanel({    title: 'Client and routing info',    items: [{        fieldLabel: 'Client',        name: 'clientName'    }, {        fieldLabel: 'Port of loading',        name: 'portOfLoading'    }, {        fieldLabel: 'Port of discharge',        name: 'portOfDischarge'    }]});myFormPanel.getForm().load({    url: '/getRoutingInfo.php',    params: {        consignmentRef: myConsignmentRef    },    failure: function(form, action) {        Ext.Msg.alert("Load failed", action.result.errorMessage);    }}); 

热点排行