ok, I did the following:
$(“#mygrid”).expandSubGridRow(rowid);
Which worked when the grid was not open. However it did not reload it. So instead I used these together:
$(“#mygrid”).toggleSubGridRow(rowid);
$(“#mygrid”).expandSubGridRow(rowid);
This way, if the grid is open, the first line closes it and the second reloads it. If the grid is closed, the the first line opens and reloads it and the second line is ignored.
by the same logic, to close the grid without knowing if it is open or not, I used:
$(“#mygrid”).expandSubGridRow(rowid);
Thanks for the swift reply.
I am loading JSON data from a separate URL using setGridParam which then triggers a grid reload. I don't use setGridParam to change the structure of the main grid – the idea is that all the data is in the JSON, including anything that is not visible. So the JSON data stream always contains every column, hidden or otherwise – I did this thinking it would be easiest as I would not have to change the grid structure, simply give the user the option of viewing columns.
When I do basic reloads like this, the data does appears correctly, even after the user makes a column viewing selection. However, if I use the column selection option after the data has been reloaded following a column selection, it gets very confused. It's like the column selector has lost its way and doesn't know what order the columns are in. The names of the columns and the actual references to the columns themselves appear to have become mixed – 'name' appears as a selectable option even though its 'hidedlg' is set to true, and when you select it, it display the 'country' column.
Are you saying that if the user chooses to hide a column, this effectively changes the grid structure – the column is not simply hidden, it's not part of the structure? I guess this would explain it. I'll keep experimenting but your input on how to avoid this would be invaluable, thank you.
I tried this and it seems to work. In the 'colnames' paramater, add an image link, remember to use backslashes, e.g
hi guys – doh, sorry, I just read up how to do this, you use the 'hidedlg' option in the colmodel. Sorry, will do more research next time…
just to add, as
thank you! I will try this out and if I get it working I will post it here for the community
hi Tony – if you look at the link I posted and go to examples, you will see what I mean. The subgrid module is great but this is something simpler. An option whereby If the text of a row does not fit into the row, you would be able to click the '+' and the whole row would expand downwards so that all the text could be seen.
hi guys, sorry to be such a noob, I am learning as I am going along. To solve this problem I just used :
setGridParam({
hi guys, here is an update for anyone that can help. I changed the code so that the jquery grid command is actually used to load the grid into the div, which seems to be fine. however, it only works the first time. If I try to reload the grid with different parameters, it doesn't work.
Can the grid only load once at the start? Basically what I need is a 'search results' pane which is a grid inside a div showing search results from a database. However these results can vary and they need different grids as some searches have different columns that need to be shown. So I need to be able to reload a new grid into the same pane.
Any ideas? thanks again
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top