Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have prepared a <a href="http://jsfiddle.net/TtM46/1/" rel="nofollow">generic working example</a>, which triggers the selection event correctly (jsFiddle). What it basically does is adding the columns, adding some data and finally adding a function to react on the <code>onSelectRow</code> event as follows:</p> <pre><code>$("#grid").jqGrid('setGridParam', {onSelectRow: function(rowid,iRow,iCol,e){alert('selected id='+rowid);}}); </code></pre> <p>Click twice or more times on any row, it fires as expected.</p> <p>As suggested by Bikonja, if your issue is more specific to the functions you have added, please modify the example I gave you by the link and post it so we can see if there is any side-effect (e.g. from other linked JavaScript libraries).</p> <hr> <p>Entire <strong>JavaScript</strong> code:</p> <pre><code>var data = [[12345, "ABC", "", "3454354", "OPEN"], [98765, "DEF", "", "452673", "CLOSED"]]; $("#grid").jqGrid({ datatype: "local", height: 250, colNames: ['Inv No', 'User ID', ' ', 'Number', 'Status'], colModel: [{ name: 'id', index: 'id', width: 60, sorttype: "int"}, { name: 'fld1', index: 'fld1', width: 90, sorttype: "date"}, { name: 'fld2', index: 'fld2', width: 10}, { name: 'fld3', index: 'fld3', width: 80, sorttype: "float"}, { name: 'fld4', index: 'fld4', width: 80, sorttype: "float"} ], caption: "Stack Overflow Example" }); var names = ["id", "fld1", "fld2", "fld3", "fld4"]; var mydata = []; for (var i = 0; i &lt; data.length; i++) { mydata[i] = {}; for (var j = 0; j &lt; data[i].length; j++) { mydata[i][names[j]] = data[i][j]; } } for (var i = 0; i &lt;= mydata.length; i++) { $("#grid").jqGrid('addRowData', i + 1, mydata[i]); } /* $("#grid").jqGrid('setGridParam', {ondblClickRow: function(rowid,iRow,iCol,e){alert(dbl clicked id='+rowid);}}); */ $("#grid").jqGrid('setGridParam', {onSelectRow: function(rowid,iRow,iCol,e){alert('selected id='+rowid);}}); </code></pre> <p><strong>HTML Table</strong> definition:</p> <pre><code>&lt;table id="grid"&gt;&lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload