Question

Is there some way to use the standard jQuery events with SlickGrid? For example.

grid = new Grid($("#myGrid"), data, columns, options);
grid.blur(function(){}); // this would be nice

// this will let me add jQuery events to the whole grid, but 
// I lose the cell position/data
$("#myGrid").blur(function(){}); 

Thanks in Advance!

Was it helpful?

Solution

The short answer is NO.

To elaborate, SlickGrid is not a jQuery plugin and does not extend jQuery in any way. It is a separate component that uses jQuery under the hood. It has explicitly defined events that you can subscribe to by setting event handlers on the grid instance. While some of the "standard" events do apply to the DOM nodes generated by the grid, their use is discouraged. The nodes are being created and removed by SlickGrid as you scroll, so you cannot rely on them staying the same or event being there. Unless you have a good understanding of SlickGrid internals, it is best to stick with explicitly defined events.

Initially, I have considered changing SlickGrid to use jQuery events but I have decided against it. While I have chosen to use jQuery as the framework for SlickGrid, there is no need to force the users to learn and use it as well. This also gives me the flexibility to switch to another framework at a later time.

OTHER TIPS

You can always look into rendered code and apply .blur() to created container.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top