1. #41
    Ext User
    Join Date
    Sep 2009
    Posts
    51
    Vote Rating
    0
    harsha_velicheti is on a distinguished road

      0  

    Default


    Quote Originally Posted by MaximGB View Post
    This is used to control selection, by clicking on the root title you'll deselect all and thus pager will switch to root nodes level, otherwise pager shows data for the last selected node.
    Hi maxim,
    Bbut i guess the root title is not supposed to come above the header right(i have seen your examples and it is not coming above header) please let me know if you have any idea where i might have went wrong.
    On the second problem i want all the trees to be expanded when the grid is shown, so i am using autoExpandColumn config, but the trees are not epanded.

    Thanks in advance
    harsha

  2. #42
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Hi!


    I really like your EditorGrid Extention, exactly what I need :-)
    But I'm facing some problems using the EditorGrid with the AdjustancyListStore, here's the problem: http://screencast.com/t/NmM5YmQ1Nj
    Any ideas on that?

    And the extention seems to have an bug when using the tbar an error thrown:
    uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER)" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://mydomain.com/ext-all-debug.js :: anonymous :: line 21688" data: no]

    thx
    Dumas

  3. #43
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    Hi Dumas.

    Nice screencast. I think you are facing the problems due to your top level nodes has 'parent' field set to "null" which is a string value, but it should be just null without quotes
    Use the force - read the source.

  4. #44
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    Hi Harsha.
    Quote Originally Posted by harsha_velicheti View Post
    Hi maxim,
    Bbut i guess the root title is not supposed to come above the header right(i have seen your examples and it is not coming above header) please let me know if you have any idea where i might have went wrong.
    I think you have seen the examples of the treegrid for ExtJS version 3.x, they don't have the breadcrumbs facility. I've decided to get rid of that after I've ported my extension to work with ExtJS 3.x.
    Quote Originally Posted by harsha_velicheti View Post
    On the second problem i want all the trees to be expanded when the grid is shown, so i am using autoExpandColumn config, but the trees are not epanded.
    This config property doesn't control the expansion of tree grid, it controls the horizontal expansion of a column. If you want some treegrid nodes to be expanded upon loading then you have to do it manually using store's expandNode/collapseNode methods.
    Use the force - read the source.

  5. #45
    Ext User makcs's Avatar
    Join Date
    Mar 2008
    Posts
    7
    Vote Rating
    0
    makcs is on a distinguished road

      0  

    Default


    MaximGB, Thanks for the great extension!!!

    Would you please help me with this problem... I attempt send data via Direct...
    Read (load) and update requests work ok. But remove(destroy) and add(create) requests not present.. i catch events only. Many events add/remove fired on expandAll method, but no one request to server... How i can use direct with TreeGrid? May be use it without crud - call create and destroy from handlers?

    Sorry for my bad English...

    Code:
    recordNomkStore = Ext.data.Record.create([
    	{name: 'name', type: 'string'},
    	{name: 'cod', type: 'string'},
    	{name: 'comment', type: 'string'},
    	{name: '_id', type: 'int'},
    	{name: '_parent', type: 'auto'},
    	{name: '_is_leaf', type: 'bool'}
    ]);
    
    dsNomkStore = new Ext.ux.maximgb.tg.AdjacencyListStore({
    	id: 'dsNomk'
    //		,restful: true
    	,autoLoad: true
    	,autoSave: true
    //		,paramsAsHash: false		
    	,api: {
    		create: TreeNomks.create,
    		read: TreeNomks.read,
    		update: TreeNomks.update,
    		destroy: TreeNomks.destroy
    	}
    	,reader: new Ext.data.JsonReader({ idProperty:'_id',root:'root' }, recordNomkStore )	
    	,writer: new Ext.data.JsonWriter({ encode: false })
    });
    Code:
    Ext.ns('NomkTreeGrid');
    NomkTreeGrid = Ext.extend(Ext.ux.maximgb.tg.EditorGridPanel, {
    //    border:false
        constructor:function(config) {
            config = config || {};
            config.listeners = config.listeners || {};
            Ext.applyIf(config.listeners, {
    			beforeedit: function(e){
    				if ( !e.record.get('_is_leaf') && ( e.field != 'name' ) )
    					return false;	
    			}
            });
            NomkTreeGrid.superclass.constructor.call(this, config);
        } // eo function constructor
        ,initComponent:function() {
            var config = {
    			tbar: [{
    				text: 'Добавить',
    				scope: this,
    				handler: function(){
    					var sm = this.getSelectionModel();						var r = sm.getSelected();
    					
    					if ( !r || r.get("_is_leaf") ){
    						Ext.MessageBox.alert( 'Сообщение', 'Выбирите группу к которой хотите добавить новую запись...' );
    						return;
    					}
    					
    					this.store.expandNode(r);
    					
    					childID = Ext.id();
    					var newRecord = new recordNomkStore({
    							 name: "Child " + childID, 
    							 _id: childID, 
    							 _is_leaf: true, 
    							 _parent: r.get("_id")
    						}, 
    						childID
    					);
    					this.store.addSorted( newRecord );
    					sm.selectRecords([newRecord]);
    				}
    			}, {
    				text: 'Удалить',
    				scope: this,
    				handler: function(){
    					var s = this.getSelectionModel().getSelections();
    					for(var i = 0, r; r = s[i]; i++){
    						this.store.remove(r);
    					}
    				}
    			}],
    			title: 'Номенклатура',
    			store: dsNomkStore,
    			master_column_id : 'name',
    //			plugins: [ _getRowEditor() ],
    			sm: new Ext.grid.RowSelectionModel(),
    			columns: [{
    				id:'name',
    				header: "Наименование", 
    				width: 400, 
    				sortable: true, 
    				dataIndex: 'name' 
    				,editor: new Ext.form.TextField() 
    			},{
    				header: "Примечание", 
    				width: 400, 
    				sortable: true, 
    				dataIndex: 'comment' 
    				,editor: new Ext.form.TextField() 
    			}]
    			,stripeRows: true
    //			,autoExpandColumn: 'name'
    			,viewConfig: {
    				forceFit		: 	true,
    				enableRowBody	:	true
    			}
            }; // eo config object
    		
            Ext.apply(this, Ext.apply(this.initialConfig, config));
            NomkTreeGrid.superclass.initComponent.apply(this, arguments);
        } // eo function initComponent
        ,onRender:function() {
            NomkTreeGrid.superclass.onRender.apply(this, arguments);
        } // eo function onRender
    }); // eo extend
    Ext.reg('NomkTreeGrid', NomkTreeGrid);
    A posse ad esse non válet consequentia

  6. #46
    Ext User
    Join Date
    Nov 2007
    Posts
    1
    Vote Rating
    0
    flyzb618 is on a distinguished road

      0  

    Default performance of the maximgb treegrid for ext3.0

    performance of the maximgb treegrid for ext3.0


    I changed my code from ext 2.3 to 3.0,so I also changed the treegrid. And I found the bug,if I have a node with 100 children nodes,the node can't load normaly after the js client recieved the json data from the server. But in the version of treegrid for ext2.x,there is no the problem and the node can fastly load 100 children nodes .
    Who can help me?

  7. #47
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Hi!

    I'm facing a problem using the tg.EditorGridPanel with the AdjustancyListStore (which extends the AbstractTreeStore which extends the Ext.data.DirectStore). I tried to write an addRecord function, but it doesn't work
    For details it's much easier to see the problem in a screencast: http://screencast.com/t/YzA2MTIxZ
    Can anybody help me?


    thx
    Dumas

  8. #48
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    53
    Vote Rating
    0
    richgoldmd is on a distinguished road

      0  

    Default


    This extension looks great - but when I expand a node in my code the rows are added at the end - not under the parent node. Collapsing the node removes them, but they remain at the end of the table, not under the appropriate parent row.

    Any ideas?

    Rich

  9. #49
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    53
    Vote Rating
    0
    richgoldmd is on a distinguished road

      0  

    Default


    Quote Originally Posted by richgoldmd View Post
    This extension looks great - but when I expand a node in my code the rows are added at the end - not under the parent node. Collapsing the node removes them, but they remain at the end of the table, not under the appropriate parent row.

    Any ideas?

    Rich
    Ok - turns out - I am using parent id == 0 for root nodes, but the comparison to null fails in the store. SO I made this change:
    Code:
    Ext.ux.maximgb.tg.AdjacencyListStore = Ext.extend(Ext.ux.maximgb.tg.AbstractTreeStore,
    {
        /**
         * @cfg {String} parent_id_field_name Record parent id field name.
         */
        parent_id_field_name : '_parent',
        root_node_value: null,           // <-- Added
            
        getRootNodes : function()
        {
            var i, 
                len, 
                result = [], 
                records = this.data.getRange();
            
            for (i = 0, len = records.length; i < len; i++) {
                if (records[i].get(this.parent_id_field_name) == this.root_node_value) { // <-- Changed
                    result.push(records[i]);
                }
            }
            
            return result;
        },

  10. #50
    Ext JS Premium Member canxss's Avatar
    Join Date
    Sep 2008
    Posts
    184
    Vote Rating
    3
    canxss is on a distinguished road

      0  

    Default


    Hi,

    Is the latest version on your download side compatible with 3.1.1? I'm trying to upgrade my app to 3.1.1 and the TreeGrid using an AdjacencyListStore renders and works correctly. But previously I was using Saki's Ext.ux.GridSearch plugin with TreeGrid without a problem (since TreeGrid was extending Grid I had no problems). And it's a lifesaver when trying to quickly locate an item on the grid.

    But with 3.1.1 it doesn't work. In my app I don't get any exceptions but I also don't see the filtered result from the plugin. I checked the plugin first and it works OK with other grids. And I also checked the filtered result from the plugin for TreeGrid and I verified that the store filter correctly finds the matching rows. But as I said they don't appear on TreeGrid which was working perfectly before.

    Thanks in advance