We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28840
    • 46 Posts
    Hi folks!
    I’ve got a bit of jam i cant get to manage to work...
    I have an extension of modx.tree.Tree element:

    SCC.tree.categories = function(config){
        config = config || {};
        Ext.applyIf(config,{
    		url: SCC.config.connectorUrl
    		,action: 'categories/getNodes'
    		,expandFirst: true
    		,rootId: '0'
    		,rootName: 'Top categories'
    		,rootVisible: true
    		,sortAction: 'categories/nodesUpdate'
    	});
        SCC.tree.categories.superclass.constructor.call(this,config);
    };
    Ext.extend(SCC.tree.categories,MODx.tree.Tree,{
    	,getMenu: function(n,e) {
            var m = [];
            m.push({
                text: _('SCC.categories.update')
                ,handler: this.updateCategory
            });
    ...
    ...
            
    	,updateCategory: function(btn,e) {
    	    if (!this.updateSCCWindow) {
        	    this.updateSCCWindow = MODx.load({
            	    xtype: 'scc-window-category-update'
                	,record: this.record
                    ,listeners: {
        	            'success': {fn:this.refresh,scope:this}
            	    }
    	        });
        	} else {
    	        this.updateSCCWindow.setValues(this.menu.record);
        	}
    	    this.updateSCCWindow.show(e.target);
    	}
    

    I know some } are missing from code block (not copying everything), but my problem is the line:
    ,record: this.record

    which doesnt work on trees but only on grids...
    So my question is, which object properties i must attach to get the record line?

    Hope I was clear enought...

    Sumoborac
      • 28215
      • 4,149 Posts
      this.cm.activeNode.attributes
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 28840
        • 46 Posts
        Arght... i f*** up the update from 2.0 to 2.1 so i’ll need a day or two to get it back running.

        I’ll get back with the results smiley


        Sumoborac
          • 28840
          • 46 Posts
          @splittingred -> IT WORKS =) Thank you alot smiley

          Sumoborac