Search code examples
jquerygridster

Handle click event with Gridster


Using Gridster, I can bind events on start and stop dragging. But how can I bind event to a single click on an item? I need to be able to select an item in order to remove it, or to set some properties to it.


Solution

  • You can use jquery click events to bind single click on an element. Here is an example of the same. Following is the general layout of the binding.

           $('.layout_block').click(function () {
                    //function to set some properties using $(this)
                    //setting an identifier to remove the element
           }
    

    Here layout_block is the class to all the elements of gridster.