Hybrid View

  1. #1
    Sencha User in2rd's Avatar
    Join Date
    May 2009
    Location
    Hawaii
    Posts
    11
    Vote Rating
    0
    in2rd is on a distinguished road

      0  

    Default 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.

  2. #2
    Sencha User loiane's Avatar
    Join Date
    Aug 2009
    Posts
    184
    Vote Rating
    53
    loiane is a jewel in the rough loiane is a jewel in the rough loiane is a jewel in the rough

      0  

    Default


    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

  3. #3
    Sencha User
    Join Date
    May 2007
    Posts
    22
    Vote Rating
    0
    timothy is on a distinguished road

      0  

    Default


    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:

    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]
    Then when I try to use the widget, I get this error:

    Code:
    c is not a constructor
    [Break On This Error] this.instantiators[len...'return new c('+args.join(',')+')');
    ext-al...ents.js (line 6456)
    This is the code block that I am using:

    Code:
    function(response)
    {
    	mask.hide();
    	var win=Ext.widget('devResWin');
    	win.add
    	(
    		Ext.widget
    		(
    			'objectbrowser',
    			{
    				data: response	
    			}
    		)
    	);
    }
    Any ideas?

    Thanks in advance!

  4. #4
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    D'oh! I just wrote one of these over the weekend. Interested in seeing it?

  5. #5
    Sencha User in2rd's Avatar
    Join Date
    May 2009
    Location
    Hawaii
    Posts
    11
    Vote Rating
    0
    in2rd is on a distinguished road

      0  

    Default 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.

  6. #6
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    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/