Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax won't work after upgrade to ZFDatagrid 0.8 #889

Open
vfallik opened this issue May 25, 2013 · 0 comments
Open

Ajax won't work after upgrade to ZFDatagrid 0.8 #889

vfallik opened this issue May 25, 2013 · 0 comments

Comments

@vfallik
Copy link

vfallik commented May 25, 2013

It's several years I'm using ZFDatagrid in our webapps.

I have recently decided to upgrade the datagrid from 0.7 to the latest release (0.8).

I made all required changes as reported in http://code.google.com/p/zfdatagrid/wiki/Upgrade.

As of now all functionalities seem to be working nicely but the ajax.
In particular, the "setAjax" function seems to be ignored at all and all the datagrid links (i.e. the link for pagination) are not ajax link.

What I can say is that:

  • The datagrid has unique ID
  • The grid doesn't use CRUD methods.
  • The same code works very well with the previous ZFDatagrid release (0.7).

Maybe I'm missing something? Do you have suggestions?

The code I use to create the grid is the following:

public function grid($id, $source = null, array $coloptions=null) {

    $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/grid.ini', 'production');
    $grid = Bvb_Grid::factory('Table', $config,$id);
    // I ALSO TESTED THIS WAY: AJAX STILL WON'T WORK AND MOREOVER ALL EXPORTS STOP TO WORK TOO

    //$grid = Bvb_Grid::factory('Table', $config);

    $grid->setAjax($id);
    $grid->setEscapeOutput(true);
    $grid->setcharEncoding('UTF-8');
    $grid->setDefaultEscapeFunction('htmlentities');
    $grid->setShowFiltersInExport(true);
    $grid->setExport(array('excel', 'print'));
    if (isset($source)) {
        $grid->setSource($source);
        $grid->setGridColumns($grid->getFields());
        $this->addExtraColumns($grid, $colptions);
    }

    $grid->setRecordsPerPage(10);
    $grid->setPaginationInterval(array('10' => '10', '50' => '50', '100' => '100'));
    $this->removePaginationOnExport($grid);
    $grid->setView($this->view);
    return $grid;
}

Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant