When theme_ext_js() renders its URL for the JsonStore, it only uses the $view and $display_id. It does not pass any arguments that might be a part of the View request.
Example: I have a View at /inventory/history that shows all products moved into and out of all inventory locations. Ext works fine for this, but I can also call /inventory/history/803 to only get inventory moves for a single location. Ext doesn't use the argument, so I always get the full list.
I have tested /ext/json/Inventory_Moves/page_1/803 and it properly returns the data for a single location.
It seems to me it might be as simple as:
foreach($argument as $key => $value) {
$display_id.='/'.$value;
}I just haven't been able to figure out how to get an array of the arguments passed, yet.
Comments
Comment #1
apanag commentedHello rgorski,
sorry for the delay response but i was on holidays for a few days.
Currently theme_ext_js() is not supporting arguments, but i am going to add the arguments functionality in theme_ext_js() in order to support views better.
Stay tuned,
apanag
Comment #2
apanag commentedI just updated the lastest cvs snapshot with code to implement views arguments.
Please test it and if you have any problems, let me know.
Thanks,
apanag
Comment #3
apanag commentedComment #4
rgorski commentedIt was my turn to be away, so I didn't get to test this until today.
It still didn't work for me as it was. I made some (ugly) changes that did get it working.
In ext-grid.tpl.php I changed the call to the theme:
In ext.theme.inc I changed the arguments defined and added a loop immediately after:
Anywhere there is a '%' in the view path, it replaces it with the argument that's actually in its place.
I'm not sure how hard it will break when someone does something unexpected, but the tech level of my users is such that it really shouldn't happen much here. (Famous last words!)
I'm sure it can be made cleaner some other way, but I'll use this for now since it's working.
Thanks.
Comment #5
apanag commentedWelcome back!
You are absolutely right, i updated the ext_json.module to support views arguments and i didn't update the grid to support them.
I 'll check your code and try to provide a more cleaner solution asap.
Best regards,
apanag
Comment #6
apanag commentedI just posted a new version, supporting your feature.
I am waiting for your feedback.
Thanks,
apanag
Comment #7
apanag commented@rgorski
Have you tried the latest snapshot? Any feedback?
Thanks in advanced,
apanag
Comment #8
apanag commented@rgorski
Have we any feedback on this?
apanag
Comment #9
apanag commentedΙ am closing it.
If someone has problems, please reopen it.