Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    70
    Vote Rating
    0
    robertdbuckley is on a distinguished road

      0  

    Default How to call a function from a qtip?

    How to call a function from a qtip?


    Hi,

    I am simply trying to call a function from a qtip. The function should open an ext.window and display html. Nothing complicated, but it doesn´t work.

    Cann anyone tell me how to achieve this?

    Thanks,

    Rob


    Code:
    function metadata() {
                        if (!winMetadata) {
                            var node = treePanel.getSelectionModel().getSelectedNode();
                            var layername = node.text;
                            var winMetadata = new Ext.Window({
                                title: '<span style="color:#00; font-weight:bold;">Metadaten: </span>' + layername,
                                layout: 'fit',
                                text: layername,
                                width: 800,
                                height: 500,
                                closeAction: 'hide',
                                plain: true,
                                items: [ct],
                                buttons: [{
                                    text: 'Schlie&szlig;en',
                                    handler: function () {
                                        winContext.hide()
                                    }
                                }]
                            })
                        }
                }
    
    
    // code in tree
    ....
    qtip: "<a href='#' onclick='metadata();'>Metadata</a>
    ...

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Posts
    36
    Vote Rating
    1
    kaendsle is on a distinguished road

      0  

    Default


    I don't have experience doing this inside a QuickTip pop-up, but I believe you can achieve the desired result wherever HTML is allowed by simply writing event handling into an anchor.

    For example, I have a Google Maps API web application that includes a directions utility (ExtJS Window) accessible through a link in any marker's pop-up InfoWindow. I just call a function (App.utils.getDirections) when the link is clicked:
    Code:
    <a href="#" onclick="App.utils.getDirections(' + d.strc_num.toString() + ',' + lat + ',' + lng + ');">Get Directions</a>
    The function generates an Ext.Window subclass instance and then calls the show() method on that window.

    EDIT: I realize you have implemented what I suggested so far, and I think the problem is in your metadata() function. I think the problem is that you are instantiating a window called winMetadata but you aren't calling the show() method on it. The business-end (and end of the function) of my equivalent getDirections() function does just that:

    Code:
                obj = new App.utils.Utility(config);         
                obj.show();
    Last edited by kaendsle; 16 Aug 2011 at 8:28 AM. Reason: Clarity

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar