sencha > stroe 跨域

2019-04-15 18:49发布

TYPE 使用jsonp     sencha store Ext.define('Sencha.store.IndexListST', { extend: 'Ext.data.Store', //继承 config: { fields: ['range','ar_id','pic', 'title','date'], autoLoad: true, proxy: { type: 'jsonp', url: 'http://192.168.1.199/duduke/json/1.php?type=index_list', reader: { type: 'json' } } } });     服务器端 '1','ar_id'=>'332','pic'=>$pi,'title'=>'werasf asdfasd dsf','date'=>'2012-3-5'); $ar[] = array('range'=>'2','ar_id'=>'331','pic'=>$pi,'title'=>'test123','date'=>'2012-3-5'); $ar[] = array('range'=>'3','ar_id'=>'442','pic'=>$pi,'title'=>'test123','date'=>'2012-3-5'); header('Content-Type: text/javascript'); echo $callback . '(' . json_encode($ar) . ');';