1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    mnj_gautam is on a distinguished road

      0  

    Default Need help related to tooltip functionality

    Need help related to tooltip functionality


    We are using EXTJS 3.1.0

    There is a functionality where we have to add tooltip to an image, using code:

    function loadToolTip(objImageId,entity_id,entity_type){
    var objImage = document.getElementById(objImageId);

    var tp = new Ext.ToolTip({
    target: objImage,
    autoLoad: {url: ‘some URL’},
    showDelay:500
    });
    var extObjImage = Ext.get(objImageId);
    tp.showAt([extObjImage.getX()+25,extObjImage.getY()+25]);
    if(tp.anchorEl){
    tp.anchorEl.hide();
    }

    This function is called on the mousover event of a image.

    It is possible that the user does mousover on the image after changing some data and everytime we have to get the tooltip contents from the server.

    The problem we are facing is, it creates multiple tool tips every time we do an mouse over.

    Ideally we would want it to be displayed only once. We tried giving id to the tool tip object and then calling .destroy() method on that object when mouseout event occurs. This also does not work and at times gives JS error.

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    mnj_gautam is on a distinguished road

      0  

    Default Need help related to tooltip functionality

    Need help related to tooltip functionality


    We are using EXTJS 3.1.0

    There is a functionality where we have to add tooltip to an image, using code:

    function loadToolTip(objImageId,entity_id,entity_type){
    var objImage = document.getElementById(objImageId);

    var tp = new Ext.ToolTip({
    target: objImage,
    autoLoad: {url: ‘some URL’},
    showDelay:500
    });
    var extObjImage = Ext.get(objImageId);
    tp.showAt([extObjImage.getX()+25,extObjImage.getY()+25]);
    if(tp.anchorEl){
    tp.anchorEl.hide();
    }

    This function is called on the mousover event of a image.

    It is possible that the user does mousover on the image after changing some data and everytime we have to get the tooltip contents from the server.

    The problem we are facing is, it creates multiple tool tips every time we do an mouse over.

    Ideally we would want it to be displayed only once. We tried giving id to the tool tip object and then calling .destroy() method on that object when mouseout event occurs. This also does not work and at times gives JS error.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,144
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    All you have to do is save a reference to the tooltip somewhere like on a component as a property so that when the mouseout fires you can easily grab the reference.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,144
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Moved to Ext JS 3 Help forum.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1