Skip to content
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

Can we make it use Ajax? Ajax Massactions and Ajax Filtering would be awsome! #154

Closed
isisis opened this issue Jan 15, 2015 · 6 comments
Closed

Comments

@isisis
Copy link

isisis commented Jan 15, 2015

First of all, thx for this nice Module. Some Ajax functionality would be really awesome.
Is it possible to send Ajax Massactions? If we send Ajax Massactions it's also a must-have to filter the grid and fill new data by Ajax without reloading the page. Otherwise the Ajax Massactions wouldn't make sense.

Why?
This could be used as an easy way to add X-to-Many relations on the edit page of an Entity. So the ajax grid could be rendered next to the form elements and would send the entities id with its massaction ajax request, without even beeing a form element.

Even better solution!
If it's not too hard to implement would be a ZfcDatagridFormElement, which can also filter data by ajax. The ZfcDatagridFormElement won't send the data, but write all selections to a hidden form element, so all selected IDs would be sent with the form. The selected IDs could be stored in a multiselect I guess.

Even more nice awesome stuff
A ZfcDatagridDoctrineFormElement would be mega aswome. Just working as the other one I described, but can populate data to doctrine entities.

@ThaDafinser
Copy link
Owner

Hi @isisis thank you for the feedback.

If i understand it correctly u are describing three things: AJAX in general, mass actions and "crud" operations?

About AJAX (loading data/sending): This is possible, but not with current renderer.
You could easily create a new one with extending: https://github.com/ThaDafinser/ZfcDatagrid/blob/master/src/ZfcDatagrid/Renderer/AbstractRenderer.php

Crud operations wont get implemented here, but could move to a "own" repo if wanted. I dont want it to be in here, since it adds a lot of complexity.

Mass actions are currently not like i want them, they could be enhanced if needed.

@ThaDafinser
Copy link
Owner

The jqGrid uses "AJAX" already for data loading if paging to another page: https://github.com/ThaDafinser/ZfcDatagrid/blob/master/src/ZfcDatagrid/Renderer/JqGrid/Renderer.php#L160-L163

@isisis
Copy link
Author

isisis commented Jan 28, 2015

Hey @ThaDafinser, I was not thinking of "crud operations", but just making the grid behave as a form element.

Let's assume I want to edit an Entity "A", just the normal way in a ZF2 form. The Entity "A" has relation to entity "B" with 1.000.000 entries in DB. Now showing entity B in a select dropdown for example, like Doctrines EntitySelect does, is extremely ugly and bad performing.
I would like to use a Datagrid here instead of an entity select, to search for entities and add them to my form (into hidden select element).

You think I could realize something like that, based on ZfcDatagrid, or would you just go another approach?

@imonteiro
Copy link
Contributor

Hi @ThaDafinser,
I'm also interested on this enhancement (AJAX). Do you some plan/roadmap/ideas?
Thanks

@isisis
Copy link
Author

isisis commented Feb 20, 2015

Hey @imonteiro check this out,
https://github.com/isisis/EbnkRichElement
Maybe it's enough for your requirements.

@ThaDafinser
Copy link
Owner

This issue was moved to zfc-datagrid/zfc-datagrid#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants