Page 3 of 44 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 432

Thread: TreeGrid (Ext.ux.maximgb.treegrid) extension.

  1. #21
    Sencha User
    Join Date
    Jul 2007
    Location
    Germany
    Posts
    55
    Vote Rating
    0
      0  

    Default

    Nice job - thanks for this great extension!
    I'm dumping my first steps to achieve a treegrid functionality via a row expander and using this one.
    Besides I found a minor typo/bug in the source code:

    on line 547 change
    Code:
    this.fireEvent('beforeexapndnode', this, rc) !== false
    to
    Code:
    this.fireEvent('beforeexpandnode', this, rc) !== false
    And one question: How can I "drop" the paging functionality on the sub-levels and just provide paging on the root level? I tried using just a default PagingToolbar but that doesn't work. The total count of elements shows correctly but all other numbers are displayed as 'NaN' in the toolbar.

  2. #22
    Ext User
    Join Date
    Aug 2007
    Posts
    10
    Vote Rating
    0
      0  

    Default help!

    I create TreeGrid in Tab Panel:
    Code:
    var store=new Ext.ux.maximgb.treegrid.AdjacencyListStore({
    	autoLoad: true
    	,leaf_field_name: 'leaf'
    	,parent_id_field_name: 'parentid'
    	,url: config.url
    	,reader: new Ext.data.JsonReader(
    		{
    			root: 'root'
    			,totalProperty: 'total_count'
    			,id: 'id'
    			,successProperty: 'success'
    		}
    		,['title', {name:'id',type:'int'}, {name:'parentid',type:'int'}, 'dtcreate', 'countchilds', {name:'leaf',type:'bool'}]
    	)
    });
    var grid=new Ext.ux.maximgb.treegrid.GridPanel({
    		id:pid
    		,stripeRows: true
    		,title:t
    		,store:store
    		,master_column_id:'title'
    		,autoExpandColumn:'title'
    		,columns:[
    {id:'title',header:'title',align:'left',width:200,sortable:true,dataIndex:'title'}
    ,{id:'id',header:'id',align:'left',width:60,sortable:true,dataIndex:'id'}
    ,{header:'parentid',align:'left',width:60,sortable:true,dataIndex:'parentid'}
    ,{header:'dtcreate',align:'left',width:120,sortable:true,dataIndex:'dtcreate'}
    ,{header:'countchilds',align:'left',width:50,sortable:true,dataIndex:'countchilds'}
    ]
    		,root_title: t
    		,bbar: new Ext.ux.maximgb.treegrid.PagingToolbar({
    			store: store
    			,displayInfo: true
    			,pageSize: 10
    		})
    	});
    this.mainPanel.add(
    	grid
    ).show();
    Then send JSON data:
    1.
    Code:
    {"root":[{"id":"1000000","title":"BD","parentid":"0","dtcreate":"2007-01-22 00:00:00","countchilds":"16","leaf":false}],"success":true,"total_count":1}
    2.
    Code:
    {"root":[{"id":"200000","title":"CP","parentid":"1000000","dtcreate":"2007-01-22 00:00:00","countchilds":"4","leaf":false},{"id":"300000","title":"New","parentid":"1000000","dtcreate":"2007-06-25 11:08:10","countchilds":"3","leaf":false},{"id":"4000062","title":"Main","parentid":"1000000","dtcreate":"2007-08-31 12:41:09","countchilds":"12","leaf":false},{"id":"4000063","title":null,"parentid":"1000000","dtcreate":"2007-08-31 12:43:45","countchilds":"57","leaf":false},{"id":"4000433","title":null,"parentid":"1000000","dtcreate":"2008-01-11 00:06:43","countchilds":"57","leaf":false},{"id":"4000773","title":null,"parentid":"1000000","dtcreate":"2008-02-15 11:39:27","countchilds":"0","leaf":true},{"id":"4000778","title":null,"parentid":"1000000","dtcreate":"2008-02-15 12:01:30","countchilds":"0","leaf":true},{"id":"4000779","title":null,"parentid":"1000000","dtcreate":"2008-02-15 12:02:09","countchilds":"0","leaf":true},{"id":"4000780","title":"Access","parentid":"1000000","dtcreate":"2008-02-15 12:02:43","countchilds":"0","leaf":true},{"id":"4000781","title":"Research","parentid":"1000000","dtcreate":"2008-02-15 12:12:28","countchilds":"0","leaf":true}],"success":true,"total_count":16}
    3.
    Code:
    {"root":[{"id":"202000","title":"Users","parentid":"200000","dtcreate":"2007-01-22 00:00:00","countchilds":"3","leaf":false},{"id":"205000","title":null,"parentid":"200000","dtcreate":"2007-04-11 20:45:06","countchilds":"3","leaf":false},{"id":"206000","title":"All documents","parentid":"200000","dtcreate":"2007-01-22 00:00:00","countchilds":"0","leaf":true},{"id":"400000","title":null,"parentid":"200000","dtcreate":"2007-01-22 00:00:00","countchilds":"37","leaf":false}],"success":true,"total_count":4}
    All works, but childs adds to end of tree, not into parent node....what i do wrong?
    Attached Images Attached Images
    • File Type: jpg 1.jpg (14.8 KB, 161 views)
    • File Type: jpg 2.jpg (27.0 KB, 164 views)
    • File Type: jpg 3.jpg (35.6 KB, 304 views)

  3. #23
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    537
    Vote Rating
    7
      0  

    Default

    Andrewd2
    Is online demo available?
    Use the force - read the source.

  4. #24
    Ext User
    Join Date
    Aug 2007
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by MaximGB View Post
    Andrewd2
    Is online demo available?
    no...

  5. #25
    Ext User
    Join Date
    Jun 2008
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Excellent job, this is going to be very useful.

    Can someone explain how the _lft and _rgt parameters are used to determine the nesting? I've spent some time digging around the code but I'm getting nowhere at this point.

  6. #26
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    537
    Vote Rating
    7
      0  

    Default

    Code:
    root
     +-a
     +-b
     | +-c
     | +-d
     +-e
              _lft                          _rgt
    _level 1: <1--------------root------------12>
    _level 2:  <2-a-3><4------b------9><10-e-11>
    _level 3:           <5-c-6><7-d-8>
    Use the force - read the source.

  7. #27
    Ext User
    Join Date
    Jun 2008
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Nice! Thanks

  8. #28
    Ext User
    Join Date
    Jun 2008
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by MaximGB View Post
    Code:
    root
     +-a
     +-b
     | +-c
     | +-d
     +-e
              _lft                          _rgt
    _level 1: <1--------------root------------12>
    _level 2:  <2-a-3><4------b------9><10-e-11>
    _level 3:           <5-c-6><7-d-8>
    @MaximGB

    how did you generate the _lft and _rgt values in your johnson&johnson example?

  9. #29
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    537
    Vote Rating
    7
      0  

    Default

    There is examples/tools directory in the extension archive, you can see generation code there.
    Use the force - read the source.

  10. #30
    Ext JS Premium Member
    Join Date
    Jun 2008
    Posts
    2
    Vote Rating
    0
      0  

    Smile I need a very basic example.!

    Ok, i'm trying to make a TreeGrid based on the user request, the app should start without any node on the tree.

    Would you please tell me a really really basic example of how can I add a root node to the grid and therefore adding a child node to the clicked row, and generate the _lft & _rgt values?

    Thank you for your great work, it looks great.!

Page 3 of 44 FirstFirst 1234513 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •