JqGrid's Row selected by default
I want to set a jqgrid's row by default and to do something with this event. i开发者_如何学编程s it possible ? I'm workin' with asp.net (C#) and Json
You can use setSelection method of the jqGrid to select a row. The bast place to do this is inside of loadComplete event. You can use getDataIDs method or just use data
parameter of loadComplete. In case of usage of the standard jsonReader
in data.rows
you have the array of rows send from the server and data.rows[iRow].id
is the id if the row with the 0-based index iRow
. The exact format of data
parameter of the method loadComplete depends on the datatype
of jqGrid which you use.
I'm trying to do something similar, and I'm getting some very odd results.
For one thing, the checkbox associated with the default items isn't selected.
For another, in Firebug, it shows that the aria-selected class for the enclosing row tag is set to TRUE! Click the checkbox, and it puts a check in the box while setting the aria-selected class to false... which is the opposite of what happens with the other rows.
Well, we figured out the cause of the odd behavior: indexes can't have spaces in them.
精彩评论