Git Product home page Git Product logo

Comments (5)

ThaDafinser avatar ThaDafinser commented on June 5, 2024

@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.

ThaDafinser avatar ThaDafinser commented on June 5, 2024

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.

ThaDafinser avatar ThaDafinser commented on June 5, 2024

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.

ThaDafinser avatar ThaDafinser commented on June 5, 2024

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.

ThaDafinser avatar ThaDafinser commented on June 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.