Page 4 of 4 FirstFirst ... 234
Results 31 to 38 of 38

Thread: New Editor Tree Grid Extension based on Ext.ux.tree.TreeGrid

  1. #31
    Sencha User
    Join Date
    Mar 2009
    Location
    Dallas, TX
    Posts
    20

    Default

    Quote Originally Posted by Sreekesh S K View Post
    Is it possible to implement alternate row coloring system on this plugin
    i realize that this reply is 2 years too late, but just in case it helps:

    I'm not sure how easily it'll be to alternate row coloring, however, you can try to hook into the beforechildrenrendered listener and add a CSS class to the node's underlying element. That should do the trick.

    I image something like the following will work:

    PHP Code:
        ...
        
    listeners: {
            
    beforechildrenrendered: function(node) {
                var 
    nodeIndex node.getOwnerTree().getRootNode.indexOf(node);
                if (
    nodeIndex 2node.ui.addClass('you-row-stripe-class');
            }
        }
        ... 
    hope that helps, though it probably won't since it's 2 years too late.

  2. #32

    Default

    Hi,

    Thanks darkwolfe for the reply...!!!!

    I am using Extjs 3.4 version.I also have a doubt that I am unable to use this extension which is a ux component. It would be great if you can just post a sample code to use this extension.

    Also do I also need to have the Ext.ux.tree.TreeGrid component also so as to use this extension?
    If yes can you please post some link from where I can get this compatible to your extension.

    Thanks again!

  3. #33
    Sencha User
    Join Date
    Mar 2009
    Location
    Dallas, TX
    Posts
    20

    Default

    Quote Originally Posted by garg.shivani02 View Post

    I am using Extjs 3.4 version.I also have a doubt that I am unable to use this extension which is a ux component. It would be great if you can just post a sample code to use this extension.
    Below is a simple code example used in one of my projects. It uses normal JSON tree data as loaded into any normal tree, so nothing complicated.

    PHP Code:
            var contextMenu = new Ext.menu.Menu({
                
    items: [
                    { 
    name'expand-node'iconCls'icon-expand-all'text'Expand All' },
                    { 
    name'collapse-node'iconCls'icon-collapse-all'text'Collapse All' }
                ],
                
    listeners: {
                    
    beforeshow: function (menu) {
                        var 
    menu.contextNode,
                        
    items menu.items.items;
                        for (var 
    0items.lengthi++) {
                            switch (
    items[i].name) {
                                case 
    'expand-node':
                                case 
    'collapse-node':
                                    if (
    n.isLeaf()) items[i].disable();
                                    else 
    items[i].enable();
                                    break;
                            }
                        }
                    },
                    
    itemclick: function (item) {
                        var 
    item.parentMenu.contextNode;
                        switch (
    item.name) {
                            case 
    'expand-node'n.expand(true); break;
                            case 
    'collapse-node'n.collapse(true); break;
                        }
                    }
                }
            });
            
    self.groupsGrid = new Ext.ux.tree.EditorGrid({
                
    clicksToEdit:1,
                
    height185,
                
    dataUrlself.handler '?command=get:settings.groups',
                
    autoExpandColumn'actionName',
                
    enableDDfalse,
                
    loadMask: { msg'Loading Groups and Statuses...' },
                
    enableSortfalse,
                
    ignoreNoChangefalse,
                
    expandOnDblClicktrue,
                
    contextMenucontextMenu,
                
    columns: [{
                    
    header'Group/Status',
                    
    id'actionName',
                    
    width230,
                    
    dataIndex'actionName',
                }, {
                    
    header'Distribution List',
                    
    id'distro',
                    
    width150,
                    
    dataIndex'distro',
                    
    editor: new Ext.form.ComboBox({
                        
    typeAheadtrue,
                        
    triggerAction'all',
                        
    storeself.distroStore,
                        
    lazyRendertrue,
                        
    editablefalse,
                        
    displayField'name',
                        
    valueField'name',
                        
    mode'local',
                        
    listClass'x-combo-list-small'
                    
    })
                }, {
                    
    header'Email Template',
                    
    id'template',
                    
    width150,
                    
    dataIndex'template',
                    
    editor: new Ext.form.ComboBox({
                        
    typeAheadtrue,
                        
    triggerAction'all',
                        
    storeself.templateStore,
                        
    lazyRendertrue,
                        
    editablefalse,
                        
    displayField'name',
                        
    valueField'name',
                        
    mode'local',
                        
    listClass'x-combo-list-small'
                    
    })
                }],
                
    listeners: {
                    
    beforeedit: function (e) {
                        var 
    self this;
                        if (!
    e.node.isLeaf()) return false;
                        if (
    e.field == 'template') switch (e.node.get('actionName')) {
                            case 
    'Create Ticket':
                            case 
    'Close Ticket':
                                
    MyApp.notify('Warning''Cannot set <i>' e.node.get('actionName') + '</i> template.  This field is set using the combobox above.',5);
                                return 
    false;
                            case 
    'Ticket Statuses': return false; break;
                        }
                        return 
    true;
                    },
                    
    validateedit: function(e) {
                        var 
    self this;
                        return 
    true;
                    },
                    
    afteredit: function (e) {
                        var 
    self this;
                        return 
    true;
                    },
                    
    contextmenu: function (nodee) {
                        
    node.select();
                        var 
    node.getOwnerTree().contextMenu;
                        
    c.contextNode node;
                        
    c.showAt(e.getXY());
                    }
                }
            }); 
    Quote Originally Posted by garg.shivani02 View Post

    Also do I also need to have the Ext.ux.tree.TreeGrid component also so as to use this extension?
    If yes can you please post some link from where I can get this compatible to your extension.
    The Ext.ux.tree.TreeGrid is an extension that comes bundled with ExtJS 3.4. Check the /examples/treegrid folder of your ExtJS installation for example usuage and /examples/ux/treegrid for required sources.

  4. #34

    Default How to make it buffered?

    Hi,

    Thanks alot for the reply! It has been a great help.
    I have one more doubt that can this extension be made buffered ? Please suggest something if buffering can be implemented with this extension.

    Thanks!!

  5. #35
    Sencha User
    Join Date
    Mar 2009
    Location
    Dallas, TX
    Posts
    20

    Default

    Quote Originally Posted by garg.shivani02 View Post
    Hi,

    Thanks alot for the reply! It has been a great help.
    I have one more doubt that can this extension be made buffered ? Please suggest something if buffering can be implemented with this extension.

    Thanks!!
    Garg,

    I'm not sure buffering can be done with this. It's not an actual grid component. Everything is based on the Tree component. The native Ext.ux.tree.TreeGrid extension bundled with ExtJS 3.4 extends a tree and uses the column model from the list view component, which is loosely based on the grid component. Using that foundation, i added in the editor features of the grid panel by adapting it to the column model, but the core of the component is still based on the Tree.

    I think the best you can do is load the list with just the top level all set to "leaf: false" and don't define any children, that way when expanded the tree will attempt to load the children from the server. this way you have a similar effect of buffering by not loading all the data at once. You'll just need to setup your ajax handler to process the request accordingly.

    Hope that helps!

  6. #36
    Sencha User
    Join Date
    Mar 2009
    Location
    Dallas, TX
    Posts
    20

    Default

    Quote Originally Posted by rafmak1 View Post
    any response to 4th question
    Hi Rafmak1,

    I'm not sure which question you're asking about. Reply #4 wasn't a question and the 4th reply on this page (reply #34) has already been responded to on reply #35.

    Could you paste the question you'd like answered?

  7. #37
    Sencha User
    Join Date
    Jan 2016
    Posts
    12

    Default

    Quote Originally Posted by darkwolfe View Post
    Hi gorun-ul,

    Sorry it's taken so long for me to get back to you about this. Try using a date renderer in your column config:

    Code:
    renderer : Ext.util.Format.dateRenderer('d/m/Y'),
    That should do the trick. The reason why you are getting that long annoying date string is because that is what the Ext.form.DateField component naturally outputs. It's the standard JavaScript output from a date object. The renderer should allow you to specify what you want the output to look like.

    Let me know if that helped!

    hi
    in page 3 reply #25 the solution you gave unfortunately doesn't work
    Regards

  8. #38
    Sencha User
    Join Date
    Jan 2016
    Posts
    12

    Default

    Quote Originally Posted by darkwolfe View Post
    Hi Rafmak1,

    I'm not sure which question you're asking about. Reply #4 wasn't a question and the 4th reply on this page (reply #34) has already been responded to on reply #35.

    Could you paste the question you'd like answered?

    Hi,
    and I'm sorry i get confused
    I was looking for a solution for the 4 question in reply #9 page 1
    Regards

Page 4 of 4 FirstFirst ... 234

Posting Permissions

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