Giter Club home page Giter Club logo

jq-boilerplate's People

Contributors

gfranko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gustawos

jq-boilerplate's Issues

Callbacks will not work in your plugin "create" function.

The _callbackSupport() realization requires the plugin obj to be stored in the element's data.

callback.call(self.$element.data(dataName), self.$element);

but according tho this

                // Instantiates a new `Plugin` object and creates the plugin
                plugin = new Plugin(this, options, dataName).create();

                /*
                Stores the new `Plugin` object in the calling element's 
                jQuery `data` method
                */
                $.data(element[0], dataName, plugin);

when create is called, data is still not filled.
Therefore all callbacks originating from "create" will get empty context.

_events() documentation

Found your plugin boilerplate searching wildly for how to provide an API so other programmers can add custom callbacks.

I'm still green regarding custom/namespaced events. You provide a private space for it, but i'm not sure what to do with it. A brief explanation:

My plugin builds on top of jQueryUI's Menu widget. It adds an activator button, hides the menu, and when the button is clicked it toggles visibility of the menu. Seems simple enough. But i wanted to use it in an environment with tables where each menu acts specifically on the data in a given table row. And jQueryUI doesn't provide a lot of sample info on how to give menu items custom callbacks. Also, when one menu is opened, others on the page should hide, etc...

So i have a working plugin, but i decided to see if i could clean it up with your boilerplate & want to know more about utilizing _events().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.