1. #1
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default RC2- tooltip in grid, beforeshow event

    RC2- tooltip in grid, beforeshow event


    Am I using the wrong event or what, because if beforeshow returns false, then the event is not fireed anymore, at all, only first time when the mouse is entering in view. How to get the wanted behavior: show not show depending on the column. Any help, much appreciated.
    Code:
                            view.tip = Ext.create('Ext.tip.ToolTip', {
                                // The overall target element.
                                tpl : new Ext.XTemplate(
                                ),
                                target: view.el,
                                // Each grid row causes its own seperate show and hide.
                                delegate: view.cellSelector,
                                // Moving within the row should not hide the tip.
                                trackMouse: true,
                                // Render immediately so that tip.body can be referenced prior to the first show.
                                renderTo: Ext.getBody(),
                                listeners: {
                                    // Change content dynamically depending on which element triggered the show.
                                    beforeshow: {
                                        fn : function(tip) {
                                            var el = Ext.get(tip.triggerElement);
                                            console.log(el);
                                            if(el.dom.cellIndex == 1){
                                                console.log('show tooltip');
                                            } else {
                                                console.log('not show');
                                                return false;
                                            }
                                        },
                                        scope: view
                                    }
                                }
                            });
                        }

  2. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    ok, seems that the just helped me, for those who will have the same task below the solution:
    Code:
      delegate: view.cellSelector+ columnId,
       listeners: {
                      beforeshow: {
                          fn : function(tip) {
                            var rec = this.getRecord(el.dom.parentNode);
                            tip.update(); //update with some data
                           },
                           scope: view
                        }
          }