Skip to content

onclick events / bind to function #148

@coderofsalvation

Description

@coderofsalvation

right now im solving it like this, but it would be nice if the transparency would not treat directives as strings-only.

           items: {
              item: {
  +             onclick: function(params){
  +               return '('+function(){                                                                                                                                                            
  +                 alert('hello') 
  +                 alert("world") // using doublequotes will break
  +               }+')()'
  +             }
              }
            }

I've also tried this:

           items: {
              item: {
  +             onclick: function(params){
  +               $(params.element).click( function(){                                                                                                                                                            
  +                 alert('hello') 
  +                 alert("world")
  +               })
  +             }
              }
            }

How do you people handle click-events?
Should we be able to do this in the future? :

            items: {
              item: {
  +             onclick: function(params){
  +               return function(){                                                                                                                                                            
  +                 alert('hello')
  +                 alert("world")
  +               } // currently this will be converted to a string unfortunately (so it doesn't work)
  +             }
              }
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions