PDA

View Full Version : Troy Reimer classes for JSON



kerocs
8 Sep 2009, 2:39 PM
I was playing with the Troy Reimer Classes which are available at openNTF.org.
I've created an agent which provides the JSON for a view build with this class.

With the url runthisagent?openAgent I receive

{"147BA7574A82CB83C12572EA00748415":{"ChildCount":0,"ColumnIndentLevel":0,"DescendantCount":0,"IndentLevel":0,"IsCategory":false,"IsConflict":false,"IsDocument":true,"IsTotal":false,"IsValid":true,"NoteID":"946","SiblingCount":2,"UniversalID":"147BA7574A82CB83C12572EA00748415","ColumnValues":{"0":"Basketschool"}},"1E17EE58EB3831E8C1257300004AE533":{"ChildCount":0,"ColumnIndentLevel":0,"DescendantCount":0,"IndentLevel":0,"IsCategory":false,"IsConflict":false,"IsDocument":true,"IsTotal":false,"IsValid":true,"NoteID":"A12","SiblingCount":2,"UniversalID":"1E17EE58EB3831E8C1257300004AE533","ColumnValues":{"0":"Basketschool"}}}

This is basically an array of two notes documents.

I'm trying to get this loaded into my jsonstore but I don't know how to map the fields.
Is a root mandatory ?
How do I read the values in the notesdocs ?

var store = new Ext.data.JsonStore({
root: '??????',
fields: [
{name: 'title',mapping : '?????????'}
],

// 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://xxx.com/xxxx.nsf/GenerateJSON?openAgent'
})
});

galdaka
8 Sep 2009, 10:29 PM
Hi,

I used theses classes in my implementation of Ext.Direct router for Lotus Domino wothuot problems few months ago.

http://www.extjs.com/forum/showthread.php?p=331747#post331747


Greetings,

kerocs
9 Sep 2009, 12:02 AM
Galdaka,

I've imported the Ext.Direct.Router.lss into an agent within a db that has the reimer classes but that gives errors on the use libs : Use "url" Use "JSONReader" Use "error"
I don't quite understand the use of this direct.router
Any change you providing a working example ?

tx, Johan