-
3 Aug 2011 8:12 PM #1
Javascript/JSON Object Browser
Javascript/JSON Object Browser
I've recently created a component which renders a Javascript or JSON object as a hierarchal tree, recursively building the TreeStore from said object. I needed a way to explain data structures to some friends, and this was the easiest way to do so.
I still need to add some functions to reload the TreeStore with new objects, find objects, and otherwise interact with the component, but I figured it was in a good enough state to push out.
The code is available for use on GitHub, you can see it on my blog, so take a look, feel free to clone it and play around.
-
4 Aug 2011 4:41 AM #2
Nice!
Thanks for sharing!
Sencha/Java evangelist
Author of ExtJS 4 First Look and Mastering Ext JS books
English blog: http://loianegroner.com
Portuguese blog: http://loiane.com
Sencha Examples: https://github.com/loiane
-
7 Aug 2011 6:41 PM #3
Hi,
Firstly, thanks for this extension. It is quite timely as I've just needed it for a project I'm working on.
That being said however, I cannot seem to get it to work!
A couple of things:
When I try to load it into the browser, I get this error:
Then when I try to use the widget, I get this error:Code:uncaught exception: [Exception... "Cannot modify properties of a WrappedNative" nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)" location: "JS frame :: http://connect.dev.lan/js/thirdparty/extjs/ext-all-debug-w-comments.js :: <TOP_LEVEL> :: line 6035" data: no]
This is the code block that I am using:Code:c is not a constructor [Break On This Error] this.instantiators[len...'return new c('+args.join(',')+')'); ext-al...ents.js (line 6456)
Any ideas?Code:function(response) { mask.hide(); var win=Ext.widget('devResWin'); win.add ( Ext.widget ( 'objectbrowser', { data: response } ) ); }
Thanks in advance!
-
8 Aug 2011 7:34 PM #4
D'oh! I just wrote one of these over the weekend. Interested in seeing it?
-
8 Aug 2011 7:36 PM #5
Object Browser Issues
Object Browser Issues
I'm definitely interested in seeing how you did this. Timothy, I'll take a look when I get a chance this week and figure out why you're getting that error.
-
8 Aug 2011 8:15 PM #6
Here ya go. Not fully tested yet but should give you the idea. I wanted it to match the json object viewer in the chrome debug panel as closely as possible.
http://helpmetestthat.com/jsontree/
-
9 Aug 2011 11:01 AM #7
Nice Layout
Nice Layout
ykey:
To be honest, I like your style quite a bit more. It's very clean, much easier to read and look through than what I have.
Nice job!
-
9 Aug 2011 6:24 PM #8
Thanks feel free to use it if you want, I just haven't tested it very much. It was only meant for json data so functions are not supported but shouldn't be too difficult to add.
-
10 Aug 2011 9:29 PM #9
Ah, that is very nice.
I can't wait to see what the two of you come up with when you combine these two extensions.
Please keep us updated.


Reply With Quote