1
imdb에서 데이터를로드하려고하는데 테이블 (GridPanel)에 결과가 없습니다. 그것은 내 소스 코드입니다 : ExtJs loading data
...
<body>
<script type="text/javascript">
Ext.onReady(function(){
var store1 = new Ext.data.JsonStore({
root: 'root',
idProperty: 'ID',
remoteSort: true,
fields: [
'Title'
],
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.ScriptTagProxy({
url: 'http://www.imdbapi.com/?t=True%20Grit'
})
});
// building grid panel
});
</script>
<div id="topic-grid"></div>
...
어쩌면 내가 JsonStore에서 '루트'매개 변수 변경해야
?UPDATE
나는 여전히 결과에서 httpProxy를 사용하려고하지 않지만. 내 몸 전체 내용을 넣으면 더 도움이 될지도 몰라.
<script type="text/javascript">
Ext.onReady(function(){
var store1 = new Ext.data.JsonStore({
reader: new Ext.data.JsonReader({
fields: ['Title'],
root: 'rows'
}),
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: 'http://www.imdbapi.com/?t=True%20Grit'
}),
autoLoad: true
});
var grid1 = new Ext.grid.GridPanel({
width:700,
height:500,
title:'ExtJS.com - Browse Forums',
store: store1,
trackMouseOver:false,
disableSelection:true,
loadMask: true,
// grid columns
columns:[{
id: 'Title',
header: "Topic",
dataIndex: 'Title',
width: 420,
sortable: true
}]
});
// render it
grid1.render('topic-grid');
// trigger the data store load
store1.load({params:{start:0, limit:25}});
});
</script>
<div id="topic-grid"></div>
-1 단지 PHP 예제를 언급합니다. 사용 가능한 서버 측 언어가 더 많이 있으며 질문에는 PHP로 태그가 지정되어 있지 않습니다. 구체적인 언어는 언급하지 않아야합니다. 이 문제를 해결하면 +1로 변경됩니다. – sra
@sra PHP 참조를 제거하기 위해 편집했습니다 – Ryan
@ Ryan, 정보 주셔서 감사합니다. 그러나 저는 여전히 빈 테이블을 얻고 있습니다. – bontade