I am attempting to use jquery to detect checkbox changes in a specific table (i.e., "grid1").
(FWIW - the table is a jqgrid)
But, it appears that the "selector" statement I am using is not working the way I expect.
Instead of detecting checkbox changes within the specific table (i.e., "grid1"), it is also detecting/reacting to changes in the entire document - including "grid2".
I am clearly doing something wrong with my selector. --I just don't know what.
Thanks for any help on this :-)
FYI - The jquery "selector" code looks like this...
$("#grid1 :checkbox")
{
$(this).change( function(e)
{
var t = $(e.target);
var row = t.closest("tbody").children().index(t.closest("tr"));
var rowids = $('#grid1').jqGrid('getDataIDs');
var rowid = rowids[row-1];
var rowdata = $("#grid1").getRowData(rowid);
$("#grid1").jqGrid('setRowData', rowid, rowdata);
$("#grid1").setSelection(rowid);
});
};
...and the HTML structure that looks like this...
<body>
<form id="form1">
<div>
<div>
<input type="submit" id="submit" value="Submit Grid Edits" />
</div>
<div id="div1">
<table id="grid1"></table>
<div id="pager1" ></div>
</div>
<div id="div2">
<table id="grid2"></table>
<div id="pager2" ></div>
</div>
</div>
</form>
</body>