1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    3
    Vote Rating
    1
    NathanStiles is on a distinguished road

      0  

    Default Unanswered: Grid getting tooltip from last tooltip of tree nood in previous tab

    Unanswered: Grid getting tooltip from last tooltip of tree nood in previous tab


    ext-4.2.0.663
    I have a tab panel with a tree node in tab 1 then tab 2 has a text field and a grid panel.

    In the tree node I'm assigning tooltips from json data field qtip.


    Anyway bug is whatever last top level node is in the tree, the tooltip assigned to that item becomes the tooltip for every row in the grid on the next tab.
    <rant>Then I tried to get tooltips in the grid nicely but I had to use an action column would be nice if I could just add a tip from json qtip field like in the tree node.</rant>
    I would have uploaded files etc but the upload does not wok or does not work in firefox.
    Here's my define...
    Code:
    Ext.define('Abs.menu.Menu',{
        region: 'west',
        extend: 'Ext.tab.Panel',
        split: true,
        collapsible: false,
        width: 250,
        tabBar: {
            defaults: {
                height: 24
            },height: 24
        },
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        items: [
            {
                title: ' ',
                iconCls: 'tab-ico-tree',
                flex: 1,
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                items: [{
                    xtype: 'treepanel',
                    itemId: 'tree',
                    rootVisible: false,
                    flex: 1, 
                    store: {
                        xtype: 'tree',
                        proxy: {
                            type: 'ajax',
                            url: 'index.php?mod=menu&async=1&f=c'
                        },
                        root: {
                            text: 'Categories',
                            id: 'id',
                            expanded: true
                        },
                        fields: [
                            //{name: 'id', mapping: 'i'},
                            {name: 'menu', mapping: 'm'},
                            {name: 'optn', mapping: 'o'},
                            {name: 'text', mapping: 'text'},
                            {name: 'desc', mapping: 'text'},
                            {name: 'info', mapping: 'd'},
                            {name: 'rptg', mapping: 'rptg'},
                            {name: 'type', mapping: 'type'},
                            {name: 'prgm', mapping: 'c'}
                            
                        ]
                    }, 
                    listeners: {
                        itemclick: function (t, record, item, index, e, eOpts ) {
                            if (record && record.data && record.data.leaf) {
                                Abs.menu.addHtmlClient(record.data);
                                //Ext.MessageBox.alert('Menu Called', record.data.m+':'+record.data.o);
                            }
                        }
                    }
                }]
            },{
                title: ' ',
                iconCls: 'tab-ico-search',
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                items: [{
                    xtype: 'textfield',
                    emptyText: 'Search...',
                    tmr: null,
                    lastVal: null,
                    fltr: function () {
                        var me = this;
                        var val = this.value;
                        if (val === this.lastVal) {
                            return;
                        }
                        if (!me.store) {
                            me.store = this.ownerCt.getComponent('gridMenu').store;
                        }
                        Abs.menuResult = null;
                        Abs.menuQuery = this.lastVal = val;
                        if (!val || val.length < 2) {
                            me.store.clearFilter(false);
                            return;
                        }
                        if (val) {
                            me.store.clearFilter(true);
                            me.store.filter([
                                {
                                    filterFn: function (item) {
                                        if (Abs.menuQuery.length < 5) {
                                            if (item.data.menu == Abs.menuQuery.substring(0,2).toUpperCase()) {
                                                if (item.data.optn == Abs.menuQuery.substring(2).toUpperCase()) {
                                                    Abs.menuResult = item;
                                                }
                                                return true;
                                            }
                                            if (Abs.menuQuery.length < 3) {
                                                return false;
                                            }
                                        }
                                        return new RegExp(Abs.menuQuery, 'i').test(item.data.name);
                                    }
                                }
                            ]);
                        } else {
                            me.store.clearFilter(false);
                        }
                    },
                    enableKeyEvents: true,
                    searchInit: function (me) {
                        if (!me.searchInterval) {
                            me.searchInterval = setInterval(function () { me.fltr(); }, 250); 
                        }
                    },
                    listeners: {
                        keyDown: function () {
                            this.searchInit(this);
                        },
                        keyUp: function () {
                            this.searchInit(this);
                        }
                    }
                },{
                    xtype: 'grid',
                    itemId: 'gridMenu',
                    flex: 1,
                    store: {
                        model: 'Abs.menu.Command',
                        groupField: 'group',
                        proxy: {
                            type: 'ajax',
                            url: '?mod=menu&f=n&async=1',
                            reader: {
                                type: 'json',
                                root: 'menu'
                            }
                        },
                        autoLoad: true
                    },
                    columns: [
                        //{ text: 'Results', xtype: 'templatecolumn', tpl: '{menu}:{optn} {desc}', flex: 1 },
                        {
                            xtype: 'actioncolumn', icon: 'img/info2.png', width: 20, groupable: false, hideable: false,
                            getTip: function (v,metadata,r,rowIndex,colIndex,store) {
                                return r.data.desc;
                            }
                        },
                        { text: 'Menu', xtype: 'templatecolumn', tpl: '{menu}:{optn}', width: 50, groupable: false, hideable: true, },
                        { text: 'Name', dataIndex:'name', flex: 1, groupable: false, hideable: false }
                    ],
                    features: [{
                        ftype:'grouping'
                        ,groupHeaderTpl:[
                            //'Group: ',
                            '<div>{name:this.formatName}</div>',
                            {
                                formatName: function(name) {
                                    return Ext.String.trim(name);
                                }
                            }
                        ]
                        //,groupHeaderTpl: '{menu}'
                    }],
                    listeners: {
                        itemClick: function (a,b,c,d) {
                            Abs.menu.addHtmlClient(b.data);
                        }
                    }
                }]
            },{
                title: ' ',
                iconCls: 'tab-ico-func',
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
            }
        ]
    });
    Last edited by NathanStiles; 23 Mar 2013 at 7:36 PM. Reason: ext-4.2.0.663

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,343
    Answers
    427
    Vote Rating
    197
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Haven't yet tried using this myself just yet, but looked like it might come in handy in your case:
    http://docs.sencha.com/ext-js/4-2/#!/api/Ext.ux.DataTip

  3. #3
    Sencha Premium Member CptS's Avatar
    Join Date
    May 2012
    Location
    Germany
    Posts
    39
    Vote Rating
    2
    CptS is on a distinguished road

      0  

    Default It's a bug!

    It's a bug!


    Hi,

    same problem here (I also use ext-4.2.0.663). I think it's a bug.
    I found no workaround for this.

    I hope somebody from sencha could help...?

  4. #4
    Sencha Premium Member CptS's Avatar
    Join Date
    May 2012
    Location
    Germany
    Posts
    39
    Vote Rating
    2
    CptS is on a distinguished road

      0  

    Question confirmed?

    confirmed?


    Is this confirmed as a bug yet?

  5. #5
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,343
    Answers
    427
    Vote Rating
    197
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Can you make up a simple test case that shows the issue? I tried with you example code, but there's some application logic/classes/proxies embedded.

  6. #6
    Sencha Premium Member CptS's Avatar
    Join Date
    May 2012
    Location
    Germany
    Posts
    39
    Vote Rating
    2
    CptS is on a distinguished road

      0  

    Default


    Here you can find a small example which shows the bug: http://jsfiddle.net/SNQMb/2/ (Tested in Firefox 20.0.1)
    I hope it helps.

  7. #7
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,343
    Answers
    427
    Vote Rating
    197
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    That is quite helpful indeed!
    And thanks for the bug report. Looks like this is fixed in 4.2.1 Beta!

  8. #8
    Ext JS Premium Member
    Join Date
    May 2009
    Posts
    92
    Answers
    1
    Vote Rating
    4
    extjs@peacetech.com is on a distinguished road

      0  

    Default just tried ext-4.2.1-20130425-beta.zip and the bug is still there

    just tried ext-4.2.1-20130425-beta.zip and the bug is still there


    I have the same issue and I just tried it ext-4.2.1-20130425-beta.zip and the bug is still there

  9. #9
    Ext JS Premium Member
    Join Date
    May 2009
    Posts
    92
    Answers
    1
    Vote Rating
    4
    extjs@peacetech.com is on a distinguished road

      0  

    Default take it back it is fixed!

    take it back it is fixed!


    my chrome did not refresh its caches. after pushing refresh couple of times after the build the bug is indeed fixed

  10. #10
    Sencha User
    Join Date
    Mar 2010
    Posts
    12
    Vote Rating
    1
    BCMartin is on a distinguished road

      1  

    Default


    Hi,

    is possible to paste here the fix for ExtJS 4.2.0 ? (or link for fixed beta version)

    Thanks