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 3.2.1 API 따른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
감사 브랜든