-
Notifications
You must be signed in to change notification settings - Fork 346
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
Multiple grids? #40
Comments
You use the same object twice. You have to call again the
Do you confirm @Sorien ? |
Thanks for the response. Yes i have taken the same in my testsuite, but the error still is "Source can be set just once". public function getGrid($grid, $theme = null, $id = '') The tag gets the grid by id from one grid object. |
I've never tested multiple grids yet. I'll try to make it work. |
We'll wait for Sorien :D |
Ok let's wait, thanks for the trouble! |
i'm not sure where is problem, it should be working, i'll look at it today ... for now try this $grid_1 = $this->get('grid'); $grid_2 = clone $grid_1; or look at https://github.com/S0RIEN/DataGridBundle/blob/master/Resources/config/services.xml and define new service like
and then call $this->get('grid') and $this->get('my_second_grid') it should solve your problem |
I'll already try these solutions and we get another problems. |
Same here :) I have checked cloning and this brings trouble with the filter and sortings, the columns from my entitys will be "mixed". And define a second service in sevice.xml brings this error: No suitable Column Extension found for column type: text |
ok i've fixed cloning and service so use it like this
pls let me know if its ok |
It works for me, thx. |
Thanks! My 2 grids comes up now, but sorting my grids makes trouble. I think it's a problem with the paramater "grid__id_" on the sort columns, this id is for both grids the same. |
Ok i think the problem is in the twig function "getGridUrl($section, $grid, $param = null)" or a little deeper in getHash() or getId(). But i have no idea where i can begin to find the error, so i think its a good idea to wait a little for sorien :) |
i've fixed generating hash in grid, and setId needs to be defined before setting source like example below
|
Thanks for your time, it work's now for me. |
thx for bug reports, closing ticket ... |
Hi!
i have tested youre grid in my app and its a wonderfull bundle, but i have problems with multiple grids on the same page and i doesent know what's wrong.
Error: Source can be set just once
I'm not sure if I understood this function correctly?
I hope you can get me a short tip.
Thanks for your time.
The text was updated successfully, but these errors were encountered: