My code -
onCellSelect: function(rowid,iRow,iCol,e)
{
jQuery("#createrule").click(function(){
hidePopup();
showPopUp6();
});
onCellSelect:
},
What is the exact reverse of onCellSelect
function in jqGrid?
You should don't register new
click
event handler every time if the user click in the grid.jqGrid register
click
event handler one during creating the grid. So you can do some actions in case of user click on some cell of the grid. Parametersrowid
andiCol
helps you to identify which cell was clicked and thee
parameter (the Event object ofclick
event) could gives you even more information if required. jqGrid is Open Source project. So you can any time examine the source code to understand better whatonCellSelect
do and in which context it will be called. Look at the lines of code.Just an example You can define the following formatter
in the column with the name "myColumn" and define the following CSS rule which uses
myLink
classYou will have "links" in the column.
To detect that the user clicks on such pseudo-link you can use the following
onCellSelect
callbackThe alert will be displayed on click everywhere in the column, not only on the link. If you want to detect clicking only on the link then we should test
e.tagret
which is the element which was clicked by the user:So
onCellSelect
can be used to handleclick
event on every cell of the grid. If you need to suppress selection of the grid additionally then you should usebeforeSelectRow
instead ofonCellSelect
. See the answer for example.