You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a jqGrid with a subgrid where I need to determine which element in the master grid was clicked on to cause the subgrid to be displayed. This is required when items in my subgrid are not unique so they (and their ids) can repeat for one or more elements in the master grid.
It would be very useful if one was able to pass the element which was clicked on to the grid as a second parameter to the selection_handler so that you're able to find which line was clicked on in the master grid that caused the elements in the subgrid to be displayed.
I guess this could be an option which is passed into jqgrid().
Here's a unified diff between my suggestion and the latest plugin installed via '/script/plugin install git://github.com/ahe/2dc_jqgrid.git' on 22 Jan 2010:
The ActiveRecord id for the element clicked in the master grid will be encoded in element.id which you can simply extract with a little string manipulation.
The text was updated successfully, but these errors were encountered:
I have a jqGrid with a subgrid where I need to determine which element in the master grid was clicked on to cause the subgrid to be displayed. This is required when items in my subgrid are not unique so they (and their ids) can repeat for one or more elements in the master grid.
It would be very useful if one was able to pass the element which was clicked on to the grid as a second parameter to the selection_handler so that you're able to find which line was clicked on in the master grid that caused the elements in the subgrid to be displayed.
I guess this could be an option which is passed into jqgrid().
Here's a unified diff between my suggestion and the latest plugin installed via '/script/plugin install git://github.com/ahe/2dc_jqgrid.git' on 22 Jan 2010:
$ diff -u vendor/plugins/2dc_jqgrid/lib/2dc_jqgrid.rb vendor/plugins/2dc_jqgrid/lib/2dc_jqgrid.rb.new
--- vendor/plugins/2dc_jqgrid/lib/2dc_jqgrid.rb 2010-02-12 16:17:55.000000000 +1100
+++ vendor/plugins/2dc_jqgrid/lib/2dc_jqgrid.rb.new 2010-02-12 16:07:48.000000000 +1100
@@ -193,7 +193,7 @@
subgrid_direct_link = %Q/
onSelectRow: function(id){
if(id){
In your javascript selection_handler you can do something like this:
jqgrid_click = function(id, element) {
alert('You clicked on ' + $('#' + element.id));
}
The ActiveRecord id for the element clicked in the master grid will be encoded in element.id which you can simply extract with a little string manipulation.
The text was updated successfully, but these errors were encountered: