Thanks for your reply. Actually I have a widget controller with a "val" method. It works just fine if I do:
But I'd prefer to use:
Where "SpecialInput" is the widget controller and "special_input" is the JMVC-created plugin. Having the controller name is in the code makes it better self-documenting than just saying "controller()" everywhere. (Actually, I prefer working direct with a named reference to the controller itself, but a lot of times it's easier to call a method using the latter syntax.)
$("#myelement").controller().val() // returns the expected value
But I'd prefer to use:
$("#myelement").special_input("val") // returns the jquery object for chaining
Where "SpecialInput" is the widget controller and "special_input" is the JMVC-created plugin. Having the controller name is in the code makes it better self-documenting than just saying "controller()" everywhere. (Actually, I prefer working direct with a named reference to the controller itself, but a lot of times it's easier to call a method using the latter syntax.)