views:

829

answers:

2

I'm working with the jqGrid 3.5 a lot as of recent, but I have noticed that when I add a checkbox input dynamically it can't be clicked (but it doesn't appear to be disabled). So I'm trying to search through the massive js dependencies that are part of the control but can't seem to find anything "not allowing" my checkbox to toggle. My question is this- how can I use firebug to find any events that might be causing this behavior.

+1  A: 

I would start with using firebug to look at the dom attributes of your checkbox.

When you create the checkbox, are you putting any javascript to react to someone toggling it?

You may want to try it on different browsers, and see if this is a browser specific feature, which will help in the troubleshooting.

James Black
+4  A: 

jQuery stores events in the jQuery data store for the DOM-elements. Use the console:

$("#yourelement").data("events");

Click on the result you get in the console window. The events bound to the element show up as properties on this object. Click on "function" to go to the source of this function. Place a breakpoint in any of the functions to see what's going on.

If you don't have an id on the element, use :eq(index) in your selector to only return one of the results. http://docs.jquery.com/Selectors

gregers
excellent! The only function that shows up is the jQuery 1.3.2 return fn ? this.bind(name, fn) : this.trigger(name); and I assume this woudln't have an issue w/ the usual click event of a checkbox?
Toran Billups
Sorry, I'm not familiar with jqGrid. Maybe you have to call an update function after dynamically adding the checkbox, or use jQuery live events: http://docs.jquery.com/Events
gregers