contributte / contributte/datagrid
Please add setHtmlAttribute() or addClass to addExportCallback button
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 296
- Forks
- 215
- PR merge metrics
- No merged PRs in 30d
Description
Please add ->setHtmlAttribute() or ->addClass() to addExportCallback button. When i want to add disabled class to button, i must do this:
$disabled_class = 'btn btn-xs btn-default';
if ($grid->getDataSource()->getCount() == 0) {
$disabled_class = 'btn btn-xs btn-default disabled';
}
$grid->addExportCallback(....)->setClass($disabled_class);
// much better way:
$grid->addExportCallback(....)->addClass($disabled_class);
Thank you very much!
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 the addExportCallback entry point and the button object it returns. Check how that object currently handles classes and HTML attributes, then verify that the requested class or attribute can be applied to the generated export button; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100