JqGrid's Row selected by default

不问归期 提交于 2019-12-24 08:29:37

问题


I want to set a jqgrid's row by default and to do something with this event. is it possible ? I'm workin' with asp.net (C#) and Json


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3531957/jqgrids-row-selected-by-default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!