1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| <?php
if($_GET['cmd']=='get'){
echo '{
success: true,
data: {
clientName: "Fred. Olsen Lines"
}
}';
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312"/>
<script type="text/javascript" src="./ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="./ext/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="./ext/resources/css/ext-all.css"/>
<script type="text/javascript">
Ext.onReady(function(){
var tab=new Ext.FormPanel({
region: 'center',
bodyStyle:'padding:5px',
width:500,
height:500,
frame:true,
reader: new Ext.data.JsonReader({},[
{
name: 'clientName',
mapping:'clientName',
type:'string'
}
]),
items: [
{
xtype:'textfield',
fieldLabel:'Numero de Transfert',
name:'clientName',
width:150
}
]
});
tab.load({
url: "./form.php?cmd=get",
failure : function(form,action){
alert("fail");
alert(action.failureType);
//alert(action.result.success);
},
success : function(form,action){ alert("ok"); }
});
var view=new Ext.Viewport({
layout: 'border',
items: [ tab ],
renderTo: Ext.getBody()
});
// alert(1);
});
</script>
</head>
<body style="margin:0px; padding:0px;">
<body>
</html> |
Partager