To reply to my own request here: how about adding an event to the existing list ( http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events ) which is fired on collapsing any grouping? That would allow us to hook in some code and save that state somewhere such as LocalStorage.
Tony, if I were to develop a patch to support this, would you prefer just an event added to collapsing groups, or should jqGrid directly support the ability to save state to localStorage? Would you consider the latter something jqGrid should do, or the developer implement themselves?
Ari
I can confirm the issue with version 3.7. In my case I'm setting shrinkToFit to true, but the grid is showing a horizontal scroll bar only if there is also a vertical scroll bar. That is, it appears to be calculating the necessary width to fit the grid before the data is loaded (I'm using xml loaded from a URL). Once the data is loaded and a vertical scroll bar is needed, then the content no longer fits and jqGrid draws in a horizontal scrollbar.
Interestingly, resizing the grid (I've enabled that option) by dragging the bottom right corner even a millimeter, will cause the columns to shrinkToFit again and now take into account the vertical scroll bar space, so the horizontal scrollbar goes away.
I've been unable to figure a workaround by trying to fire resize events into the grid, but I'm probably trying the wrong thing so far. Could this be marked as a bug to fix in the grid for the next release?
I think you'll need to combine the keys. You could simply append them (if they are string), or something like this key = key1 * 1024 + key2. Make the constant big enough to accomodate the complete expected range of key2, but smaller than whatever limits exist in javascript.
For anyone finding this thread, there is a way to get the rowId. That info is carried in the options. So options.rowId can give you a hook for jQuery to then addClass to. I found that here:
Thanks for your help and example. I did Google this for hours, and found only something similar to your idea on stackoverflow.com. Your example works well for certain things, but it doesn't do what I want which is to apply css to the tr or the td, rather than just inserting html. And it also doesn't work for setting the background colour.
afterInsertRow might be a better approach and I'll explore that. Thanks. You might like to add newperson's example to your docs since I'm sure that will help a lot of people (just not what I want to do here). Ideally, I wanted to apply a style to the tr so that certain rows are bold or have a different background, depending on the value of one column. So afterInsertRow may do the trick.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top