1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Italy
    Posts
    80
    Vote Rating
    0
    spillo491 is on a distinguished road

      0  

    Default Grid column render function quote problem

    Grid column render function quote problem


    Hi,

    I have a problem with quote in grid column renderer function

    Code:
    renderer : function(value, metaData, record) {
                                            return "<a href='javascript:showDetail('" + record.get('id') + "');'>"  
                                                    + "<img src='edit.png'>"
                                                    + "</a>";
                                        }
    In html code

    Code:
    <a 94');'="" href="javascript:showDetail("><img src="edit.png"></a>
    How can I resolve please ?
    Thanks

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Location
    Italy
    Posts
    80
    Vote Rating
    0
    spillo491 is on a distinguished road

      0  

    Default


    Nobody can help me ?

  3. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,747
    Vote Rating
    106
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    This is not how you write JavaScript these days:

    Code:
    href='javascript:showDetail('" + record.get('id') + "');'>"
    Instead just create a simple basic 'A' tag and listen for itemclick on the grid instead:

    http://docs.sencha.com/ext-js/4-0/#!...vent-itemclick

    in the handler you can use the 'e' argument to try to find a certain class on your a-tag that you have defined via:

    Code:
    if (e.getTarget('.your-class')) {
        // The link was clicked
    }

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Italy
    Posts
    80
    Vote Rating
    0
    spillo491 is on a distinguished road

      0  

    Default


    Thank you, it works

Thread Participants: 1