I have an entity grid used for editing a single row in a table of datas. Each row of the grid has a single submit button. The grid also has several column filters.
I need to the filters to run only to the row being submitted. But on submit, the filters get applied to every row, not just the submitted row.
The current code is (essentially) the pretty standard setup:
// previous code has already instantiated and
// configured the form, and the entities and filters
// have been add()'ed.
$form->run();
if (!$form->dataVerified()){
// output the form
} else {
// determine the row being submitted
// do db writes, etc.
}
I guess the issue is that $form->run() checks the ftl flag and invokes the column filters on *all* the rows.
Any suggestions on how to apply filters only to the row being submitted?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings!
[ SM v2.4.2 ]
I have an entity grid used for editing a single row in a table of datas. Each row of the grid has a single submit button. The grid also has several column filters.
I need to the filters to run only to the row being submitted. But on submit, the filters get applied to every row, not just the submitted row.
The current code is (essentially) the pretty standard setup:
// previous code has already instantiated and
// configured the form, and the entities and filters
// have been add()'ed.
$form->run();
if (!$form->dataVerified()){
// output the form
} else {
// determine the row being submitted
// do db writes, etc.
}
I guess the issue is that $form->run() checks the ftl flag and invokes the column filters on *all* the rows.
Any suggestions on how to apply filters only to the row being submitted?
Thanks!
Entity Grids have a directive to get the behavior you need. It is set to false by defauly. Just set it to true.
We creatively named it:
filterSubmitRowOnly
Hope that helps. If you don't have that directive available please upgrade to a later version of SiteManager.
Poifect! Udaman!
Thanks and regards,
Dave