Wednesday, April 17, 2013

[Rails] Some javascript help needed

I need a little support with js. Would be great..

I have a textfield with a hover function. If click on the popup I want a value 0 dropped into the textfield.
With the code below just a alert appears...


<div class='context-menu-one'>
  <%= h.text_field :field %>
</div>

$(function()

{
    $.contextMenu({
        selector: '.context-menu-one',
              
       items: {

           "paste": {name: "Paste", icon: "paste"},            
        }
    });  

    $('.context-menu-one').on('click', function(e){

        console.log('clicked', this); // here ???

    })

});


Thanks für your Support

Werner



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/TZyReTRBlFoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate