-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing params.id to globalFilterClosure #106
Comments
I believe I have the same issue with a subGrid. I see that the ID parameter is not being passed to the subGrid. The main grid has:
The subGrid has:
I put a breakpoint at GormDataSourceService:184 (the list() function) and watched it operate. The listParams contains "{rowOffset=0, maxRows=10}". There is no ID field in there for the globalFilterClosure to access. |
'params' should be accessible directly, without any argument.
or
|
Yes params is accessible but it doesn't have the id attribute which I can see in the controller action:
and here is the globalFilterClosure:
This is the output I see:
But no records are returned. |
You will have to use the
By default it's empty. It represents the list of parameters which the grid can use from the enclosing page. |
That's new? It worked before I upgraded. Does this go in the main grid or the subgrid? I tried putting externalParams ['id'] in the subGrid and I got this:
Here is the entire definition for the master and subGrid, in case it helps. As I said -- this worked fine before I upgraded to 1.6.3:
I also tried removing the "params ->" from the globalFilterClosure in the subGrid, but that made no difference either. The subGrid is still empty even though I know it contains data. |
Yes, externalParams is new and should have worked properly |
Thanks. Going on vacation for a while. Will revisit in mid-August when On 07/25/2014 02:15 PM, Tudor Malene wrote:
Eric H. Raskin 914-765-0500 x120 |
Have fun! |
No luck with
as discussed. Compile errors:
My current work around it to change GridUtils.groovy to
|
You can also change the gsp template:
|
Has there been any update on this yet? I am back from vacation and getting back to work. :-/ Have you managed to get externalParams fixed? |
Hi Eric, |
fixed in 1.6.4. You can do:
and the 'id' parameter will be accessible |
I am now running version 1.6.5. In my case, I have a column named "ordnum" { type 'id', property 'ordnum' }. That is the key I need to pass into my subGrid. I have added externalParams(['ordnum']) in the main grid to make it visible to the subGrid. In the subGrid, I have:
It does not work. The subGrid comes up empty each time. I also can't seem to find the right place in the code to set a breakpoint either. |
I think it would be easier if you could send me a running grails project - basically a stripped down version of this setup. ( ideally with some data added in BootStrap), so we have a better reference. |
Sorry for the long delay on this. Unfortunately, my wife took ill and passed away. I haven't been able to get back to this until now. :-/ I know you asked for a project to play with. I will try to create one. In any event, with fresh eyes, I noticed that your _jqGridRenderer.gsp template contains:
What looks strange to me is that the url createLink has a params map but the subGrid createLink does not. Worse yet, the params for each row of the subGrid have to be different - based on the data. I need some help understanding how all of this works. I see that you have the easygrid.subGridRowExpanded call, which seems to take the baseURL that links to the subGrid and then passes information that identifies the particular row in the data attribute. I'm not quite clear on how that gets used by grails to load the subGrid rows and/or jqgrid to display them. Also, I can't find any provisions for other parameters to be supplied to the subgrid. In my case, I have a globalFilterClosure like this in my subgrid:
Somehow I have to get that "ordnum" into the params inside the subGrid. It is different for each subGrid I expand, so it can't really be in the params for the enclosing grid. How do I get that ordnum passed in and referenced properly in the globalFilterClosure? |
I FINALLY figured it out!. I had a whole bunch of confusion:
So, as an example, my enclosing grid contains:
and my subgrid contains:
This now works as desired. I hope somebody else finds this helpful. |
Hi Eric, Returning to easygrid... Thanks for digging into this. |
Thanks very much. There is not much to say, but I appreciate the sentiment. This issue is now fixed for me. Thanks for your help. |
I have just upgraded from EasyGrid 1.4.3 to 1.6.3 and have noticed that a previously working globalFilterClosure no longer works as expected. I used to happily read the value of params.id and use it like so:
This was evaluated at runtime and I got the correct rows. After upgrading, the params.id value is correct in the controller but not passed through to the closure. Is the closure not evaluated at runtime any longer or am I not understanding how its meant to work. BTW the params.id value is a key to a related table to the one in the grid.
Thanks for any assistance
Ken Doig
The text was updated successfully, but these errors were encountered: