extjs json decode

0 Cevap php
 function symbol_handler(){
   fp.getForm().submit({
     url:'/index.php/ajax/test_function',
       success:function(resp){
       //how would i access attributes of the json object?
     }
 });

edit: burada php denetleyicisi, durumda da geçerlidir.

 function test_function(){
 $array = array(
    'success' => 'true',
    'msg' => 'testing testing testing'
    );
  echo json_encode($array);

}

ile console.log (solunum) çıkış

    function symbol_handler(){
     fp.getForm().submit({
         url:'/index.php/ajax/test_function',
         success:function(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

Teşekkürler, brandon

0 Cevap