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

      0  

    Default


    From my site.
    Paging feature explanation:
    If the tree grid has no selection then paging toolbar shows information related to grid's root nodes set, e.g. if it shows "Displaying 1 - 10 of 20" then there are 20 root nodes (nodes with root id === null) which are divided into two pages. If the tree grid has a selection then the paging toolbar shows information related to selected node's child node set, node must be expanded for node's paging related information is loaded. After node expanding paging toolbar shows selected node's child node set related information and the paging facility are applyed to that node's child node set only. To start paging at the root nodes you must deselect all nodes first.
    Use the force - read the source.

  2. #22
    Sencha User
    Join Date
    Apr 2009
    Location
    China
    Posts
    8
    Vote Rating
    0
    liqingzhu is on a distinguished road

      0  

    Thumbs up What should I do if I want to get the other Paramenters?

    What should I do if I want to get the other Paramenters?


    What should I do if I want to get the other Paramenters?

    As far as I know,If i use the server side ,I need to get the 'anode' as id,then I can get the next json data for the TreeGrid, If I want to get the otherthings like '_level','_rgt' etc,
    What should I do? Please tell me !

  3. #23
    Ext JS Premium Member
    Join Date
    Feb 2009
    Location
    London, UK
    Posts
    31
    Vote Rating
    0
    awebb is on a distinguished road

      0  

    Default TreeGrid and ExtJs version 3.0.3

    TreeGrid and ExtJs version 3.0.3


    Hi MaximGB,

    In preparation to upgrading our site to ExtJs 3.0.X (X = latest), today I downloaded ExtJs 3.0.3 and the 3.0-compatible version of your excellent TreeGrid.

    I looked in TreeGrid.js and saw this:-

    Code:
    if (Ext.version == '3.0') {
        Ext.override(Ext.grid.GridView, {
            ensureVisible : function(row, col, hscroll) {
    However, if you look in ext-base-debug.js for the latest ExtJs, you find this:-

    Code:
    Ext = {
        /**
         * The version of the framework
         * @type String
         */
        version : '3.0.3'
    };
    Is the 'ensureVisible' override specifically for version 3.0, or does it need to be applied to all 3.0.X versions to date?

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

      0  

    Default


    Quote Originally Posted by liqingzhu View Post
    What should I do if I want to get the other Paramenters?

    As far as I know,If i use the server side ,I need to get the 'anode' as id,then I can get the next json data for the TreeGrid, If I want to get the otherthings like '_level','_rgt' etc,
    What should I do? Please tell me !
    Use adjacency list model there are only three parameters you should provide - id of the node, it's parent id and wether the node is leaf or it's not.
    Use the force - read the source.

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

      0  

    Default


    awebb I might be wrong but I remember that this override is version 3.0 specific. Anyway you have the code so you can comment it out if it does the wrong thing.
    Use the force - read the source.

  6. #26
    Sencha User sb32's Avatar
    Join Date
    Sep 2007
    Posts
    66
    Vote Rating
    0
    sb32 is on a distinguished road

      0  

    Default


    Quote Originally Posted by MaximGB View Post
    Use adjacency list model there are only three parameters you should provide - id of the node, it's parent id and wether the node is leaf or it's not.
    The examples all use non hierarchal sample data [random company/number combinations that occur more than once]. It would make more sense to me if the data was representative of a tree structure.

    I ran through what I believe to be all the examples and in each one, all that would post to the server was anode

    Having said that, I worked around it by creating a unique id for each row essentially.

    I.e.,
    HTML Code:
    :food=>1 {
       :fruit => 2 {
          :orange=>5,:leaf=>true
       },
       :dairy=>3 {
           :milk=>6,:leaf=>true
       }
    }

    I don't like it and truly hope I overlooked a feature - Did I overlook something?

    EDIT: BTW - Awesome plugin either way!

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

      0  

    Default


    Extension supports two methods of hierarchical data representation. You can use either Adjacency List method or Nested Set method, you can read about them here http://dev.mysql.com/tech-resources/...ical-data.html
    Use the force - read the source.

  8. #28
    Sencha User sb32's Avatar
    Join Date
    Sep 2007
    Posts
    66
    Vote Rating
    0
    sb32 is on a distinguished road

      0  

    Default


    Could you share a quick example of how we can post row-level attributes back with the anode?

    I.e...
    HTML Code:
    listeners: on 'expand' () {
        store.url.params = {
              attribute_type: 'company',
              attribute_value: tree.selectednode.attributes.company
        }
    }
    Thank you

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

      0  

    Default


    It's something like that
    Code:
    store.on('beforeload', injectNodeAttrsBeforeLoad);
    ...
    function injectNodeAttrsBeforeLoad(store, options)
    {
        // Get selected node, or use store.getActiveNode() to retrieve expanded node id
        ...
        // Build custom attrs you need.
        ...
        options.params['myCustomAttr'] = myCustomValue;
    }
    Use the force - read the source.

  10. #30
    Sencha User sb32's Avatar
    Join Date
    Sep 2007
    Posts
    66
    Vote Rating
    0
    sb32 is on a distinguished road

      0  

    Default


    Because expanding a node does not select it, your method fails unless you select the node explicitly before expanding it. Here's what I resorted to:

    HTML Code:
    new Ext.ux.maximgb.tg.AdjacencyListStore({
        listeners: {
            beforeexpandnode: function(n,e) {
                this.setBaseParam('parent_id', e.json._parent);
            },
        .................
    });