PDA

View Full Version : looping data from json



bams
13 Jan 2011, 10:20 AM
Iam new with sencha please help. i wanna looping folder name in div. this is basically from example kitchen sink

//index.js

Ext.setup({
onReady: function() {
Ext.regModel('User', {
fields: ['SavedFolderID', 'UniqueID','ParentFolderID','FolderName','DateCreated', 'DateModified','DeletionDate' ],

proxy: {
type: 'ajax',
url : 'LoadAllBookmarks.json'
}
});

folderPanel = new Ext.Panel({
fullscreen: true,
scroll: 'vertical',

dockedItems: [
{
dock : 'top',
xtype: 'toolbar',
title: 'Load all bookmark',
items: [
{
text:'Load Bookmark Folder',
handler: function() {
var panel = folderPanel,
dataview = panel.items.first(),
store = dataview.store;

store.load();

}
}
],
}
],

items: [
{
xtype: 'dataview',
tpl: [
'<tpl for=".">',
'<div>',

'{FolderName}',
'</div>',
'</tpl>'
],

itemSelector: 'div.user',
styleHtmlContent:true,

store: new Ext.data.Store ({
model: 'User',
autoLoad: false
})
}
]
});

}
});



//my json

{ "Rows":[
{ "SavedFolderID":101814, "UniqueID":340785, "ParentFolderID":74937, "FolderName":"Board 2.0 issues", "DateCreated":new Date("9/9/2008 1:10:28 PM"), "DateModified":new Date("12/8/2010 1:22:41 PM"), "DeletionDate":null },
{ "SavedFolderID":101751, "UniqueID":340785, "ParentFolderID":101750, "FolderName":"Clinical Resources", "DateCreated":new Date("9/8/2008 6:17:10 PM"), "DateModified":null, "DeletionDate":null },
{ "SavedFolderID":101750, "UniqueID":340785, "ParentFolderID":74937, "FolderName":"Library", "DateCreated":new Date("9/8/2008 6:17:10 PM"), "DateModified":null, "DeletionDate":null }
],"Success":true }

showing error Uncaught Ext.data.JsonReader.getResponseData: Unable to parse JSON returned by Server.