below is the tested code.

(defn context-menu-component []
  (js/$ (fn []
          (.contextMenu (js/$ "#myTable")
                           (js-obj "menuSelector" (js/$ "#test-context-menu")
                           "menuSelected" (fn [invokedOn selectedMenu]
                                            (if (= "Edit" (.text selectedMenu))
                                              (.log js/console (.text 
selectedMenu))
                                              (.log js/console (.text 
invokedOn))
                                              )))))))

On Thursday, March 9, 2017 at 2:18:42 PM UTC-6, zain...@gmail.com wrote:
>
> I am trying to add context menu in reagent using the fiddle 
> http://jsfiddle.net/KyleMit/X9tgY/
>
> The following is the javascript code
>
> $("#myTable td").contextMenu({
>     menuSelector: "#contextMenu",
>     menuSelected: function (invokedOn, selectedMenu) {
>         var msg = "You selected the menu item '" + selectedMenu.text() +
>             "' on the value '" + invokedOn.text() + "'";
>         alert(msg);
>     }
> });
>
>
> The following is reagent/clojurescript code
>
> (defn context-menu-component []
>     (js/$ (fn []
>          (.contextMenu (js/$ "#myTable")
>              (js-obj "menuSelector" (js/$ "#test-context-menu"))
>              (js-obj "menuSelected" (fn [invokedOn,selectedMenu] (js/alert 
> "test")))))))
>
>
>
> The method menuSelected is not initialized and its not being called 
> instead the jquery method is called. Please let me know if the 
> implementation is correct.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Reagent-Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reagent-project+unsubscr...@googlegroups.com.
To post to this group, send email to reagent-project@googlegroups.com.
Visit this group at https://groups.google.com/group/reagent-project.
For more options, visit https://groups.google.com/d/optout.

Reply via email to