contributte / contributte/datagrid
onRender event
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 296
- Forks
- 215
- PR merge metrics
- No merged PRs in 30d
Description
Hi @paveljanda, @f3l1x
I have one question, I'm using DataGrid with Doctrine and in one specific case, can not use QueryBuilder and I'm sending data to DataGrid like bellow
$grid->setDataSource($em->getConnection()->fetchAll('my query'));
So, problem is, when I use inline edit, because after edit the row, changes not redraw.
I'm using workaround, than first set empty QueryBuilder and on event onRender set real DataSource, look below
$grid->setDataSource($em->createQueryBuilder());
$grid->onRender[] = function (\Ublaboo\DataGrid\DataGrid $grid): void {
$grid->setDataSource($em->getConnection()->fetchAll('my query');
};
This is very ugly and not clear, so what you thing about PR, where move call onRender events on start of render method or added new callback with name onBeforeRender?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating DataGrid's render method and the existing onRender event handling mentioned in the issue. Compare the proposed event-timing change with the alternative onBeforeRender callback, then define the expected lifecycle and verify that inline edits using fetchAll data redraw correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100