0

By rowNum I mean the number showed on the picture below.
I tried to get it like $('#gridId').rowNum but it gave me undefined. I understand that I can get it like any other html element value using jQuery, my question is does jqGrid provide any API to do that?

enter image description here

UPDATE: Version of jqGrid is 4.4.4

UPDATE 2: This question is correctly answered in the comment. Now there is another issue which has to do with this topic (Trouble with getting rowNum inside the function that handles onPaging event).

Community
  • 1
  • 1
Anton Kasianchuk
  • 1,177
  • 5
  • 13
  • 31
  • 2
    [this post](http://stackoverflow.com/questions/13461814/how-can-i-get-the-number-of-rows-displayed-in-a-jqgrid) seems to think you can use `jqGrid.getGridParam('rowNum');` – Pete Oct 13 '14 at 14:28

2 Answers2

0

.selectedIndex is the property you want for a select.

document.getElementById("gridId").options[document.getElementById("gridId").selectedIndex].innerHTML;

$('#gridId').val();
brso05
  • 13,142
  • 2
  • 21
  • 40
0

Using jQuery:

$("#gridId").val()

Or, if you need the text (not the value):

$("#gridId option:selected").text();
rogelio
  • 1,541
  • 15
  • 19