Comments (5)
@hikaru-shindo this is currently not available, because it's only for jqGrid itself. So i don't know if it's good to include such a feature.
You could use your own layout and implement it:
Copy https://github.com/ThaDafinser/ZfcDatagrid/blob/master/view/zfc-datagrid/renderer/jqGrid/layout.phtml
And change: https://github.com/ThaDafinser/ZfcDatagrid/blob/master/config/zfcdatagrid.local.php.dist#L62
from zfc-datagrid.
From @hikaru-shindo on May 9, 2014 14:25
I know this is piossible, but I think it would be better to be able to pass options to the renderer and to not override existing layouts for such small things. What do you think about a configuration key jqgrid.options
containing jqgrid options as an array. It would just be renderer specific configuration like it already is and be much cleaner then overriding the template for each small change.
from zfc-datagrid.
From @webdevilopers on May 16, 2014 13:21
+1 for jqgrid.options @hikaru-shindo . A common jqGrid feature is using footerrow and setting footerData to add totals to the grid.
Unfortunately I could not append any javascript to the grid to add this after the grid was generated.
Same for using grouping for summary. The following demo requires setting attributes summaryType and summaryTpl on columns:
summaryType:'min', summaryTpl:'<b>Min: {0}</b>
http://trirand.com/blog/jqgrid/jqgrid.html
Of course creating your own template is a possible workaround. But mostly for only this one use case.
The jqGrid Columns view helper already has the possibility to set options:
https://github.com/ThaDafinser/ZfcDatagrid/blob/master/src/ZfcDatagrid/Renderer/JqGrid/View/Helper/Columns.php#L86-95
The getter methods get their values from \ZfcDatagrid\Column\AbstractColumn.
It would make no sense to add jqgrid typical options like summaryType there.
Extending the abstract class to define a jqgrid Column would be possible.
But using a global setOptions methods maybe is a smarter solution. And the use the view helper to set an array with "allowed" values.
Another workaround is adding options to the cellattr:
https://github.com/ThaDafinser/ZfcDatagrid/blob/master/src/ZfcDatagrid/Renderer/JqGrid/View/Helper/Columns.php#L109-115
/**
* Cellattr
*/
$rendererParameters = $column->getRendererParameters('jqGrid');
if (isset($rendererParameters['cellattr'])) {
$options['cellattr'] = (string) $rendererParameters['cellattr'];
}
if (isset($rendererParameters['summaryType'])) {
$options['summaryType'] = (string) $rendererParameters['summaryType'];
}
if (isset($rendererParameters['summaryTpl'])) {
$options['summaryTpl'] = (string) $rendererParameters['summaryTpl'];
}
BTW @ThaDafinser : I could only overwrite the layout after I added the path to my template map:
'view_manager' => array(
'template_map' => array(
'zfc-datagrid/layout/jqgrid' => __DIR__ . '/../view/layout/jqgrid.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
Is there a way to simply overwrite it creating it file with the same name under /application/view/zfc-datagrid/renderer/jqGrid/layout.phtml and adding the Application module after ZfcDatagrid similar to other modules like ZfcUser?
from zfc-datagrid.
From @webdevilopers on May 20, 2014 7:50
I will devide my comment into separate issues and concentrate this issue on the improvement of the jqgrid options only.
from zfc-datagrid.
From @webdevilopers on May 20, 2014 7:52
@hikaru-shindo or @ThaDafinser : Would it make sense to rename this issue to something like "Improve setting jqgrid options" since more than just the rowList option is discussed or should I open up a new issue?
from zfc-datagrid.
Related Issues (20)
- Todo for 2.0 HOT 7
- Custom query HOT 1
- Error rendering NULLs in DateTime columns with PHPExcel HOT 2
- Use route for links or action buttons HOT 3
- Disable cache HOT 7
- Filters - Extended
- Support native ZF Event HOT 2
- Daterange Not working for Doctrine2 Datasource
- Cannot use ZfcDatagrid\Column\DataPopulation\Object as Object because 'Object' HOT 3
- The expediency of using the MvcEvent HOT 6
- Configuration conflict when set non-default cache adapter HOT 3
- Get value from another column HOT 1
- Allow changing column type's `filterDefaultOperation` HOT 1
- Drop support for PHP 5.6 and 7.0 HOT 3
- Implement all filters in ZfcDatagrid\Renderer\JqGrid\View\Helper\Columns::getStyles HOT 3
- Possibility set a column position HOT 1
- Package phpoffice/phpexcel is abandoned HOT 1
- bootstrap v4 template HOT 1
- Add datagrid filters instead of using the columns filters
- TypeError when applying toobar filter on grid with PhpArray datasource and null value in data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zfc-datagrid.