Are you using a jquery ui theme?
If so the selected row should automaticaly recieve a highlight allready.
What information do you allready have about the row.
Do you have the row id? Or the value of the field that is marked as the key?
It creates the row as defined like this. Notice that the id of the row is the same as the key value.
So then you could just do.
$("#tblselector).find("#+KeyValue").hasClass("ui-state-highlight")
This would return tru if it was selected and false if it were not selected.
This leads me to an intresting issue of having multiple grids on the same form that have rows that happen to have the same key value.
Becuase my tables use an autogenerated id field for thier primary key it is possible that if I put 2 grids on the same page that I could possibly wind up with 2 elements on the same page with the same id. This would be disasterous if I were looking for the rows just by the id's.
Well evidently from the wiki getRowData is not going to work for me. Does anyone have any ideas on how to get the original
http://www.trirand.com/jqgridw…..iki:events
You just need to define a right click event for the grid parameters.
| Event | Parameters | Description |
|---|---|---|
|
onRightClickRow |
rowid, |
Raised immediately after row was right clicked. rowid is the id of the row, iRow is the index of the row (do not mix this with the rowid), iCol is the index of the cell. e is the event object. Note – this event does not work in Opera browsers, since Opera does not support oncontextmenu event |
Ok through some server side expressions I got the XML into the correct format now.
Dont mean to be an ass but what your doing wrong at this point is not posting examples of your code.
I suggest throwing an example up on jsbin.com and sending us a link to it.
What I did was use a server side page that creates the list of columns in a json fashion. I then call this method before I create the table. Then I can just
caption: TableProps.Title,
colNames: TableProps.colNames
Works out pretty good for me because I am showing the table based on user input of a tree grid.
Thanks Tony,
Any help with this would be greatly appreciated. I cant move forward with this until I can hide columns on initialization.
I am returning all columns fromt he database but hiding the ones that are not set to be displayed based on which ones are set to be displayed in the datbase.
Do I need to supply more information?
Sorry for the late reply.
You mean something like this? http://www.codeproject.com/KB/aspnet/AspNetMVCandJqGrid.aspx
Dont mean to sound like an asshole but did you search the wiki? /jqgridwiki/doku.php?id=wiki:custom_formatter
When you define your collumn you will need to defin the formater for it.
jQuery("#grid_id").jqGrid({
…
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top