function symbol_handler(){
fp.getForm().submit({
url:'/index.php/ajax/test_function',
success:function(resp){
//how would i access attributes of the json object?
}
});
編輯:這裏是php控制器,以防萬一它是相關的。extjs json decode
function test_function(){
$array = array(
'success' => 'true',
'msg' => 'testing testing testing'
);
echo json_encode($array);
}
與
function symbol_handler(){
fp.getForm().submit({
url:'/index.php/ajax/test_function',
success:function(resp){
console.log(resp);
}
});
}
輸出的console.log(RESP)的...
Object
activeAction: null
bodyStyle: "padding: 6px"
buttons: Array (1)
0: Object
handler: function symbol_handler(){
hideParent: true
minWidth: 75
removeMode: "container"
text: "GO"
__proto__: Object
length: 1
__proto__: Array
el: Object
events: Object
frame: true
height: 100
id: "ext-gen48"
items: Object
labelWidth: 40
title: "Exercising textfields"
width: 300
__proto__: Object
謝謝,布蘭登