Git Product home page Git Product logo

Comments (2)

ThaDafinser avatar ThaDafinser commented on May 29, 2024

You did not provide any single information, from where i could starting to help you.

Post your code and maybe we can help you.

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on May 29, 2024

From @umeshjoshi on August 17, 2015 6:34

thank you for your response.
Please find below my code:

             $request = $this->getRequest();
            $toolbarFilters =   $request->getPost('toolbarFilters');
      $columns = $toolbarFilters['column_list'];
      $name = $toolbarFilters['name'];

$dbAdapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter');

$select = new \Zend\Db\Sql\Select;
$select->from(array('u' => 'contact_list'));
   if($name != '') 
   {

    $select->where(array('u.first_name'=>$name));
   }
$dataGrid = $this->getServiceLocator()->get('zfcDatagrid');
$dataGrid->setTitle('Minimal grid');
$dataGrid->setDefaultItemsPerPage(3);
$dataGrid->setDataSource($select, $dbAdapter);


$column_list = array('id'=>'ID', 'first_name'=>'First Name','last_name'=>'Last Name', 'email'=>'Email', 'gender'=>'Gender');

$dataGrid->setToolbarTemplateVariables(array('columnsList' => $column_list,'filteredColumn' => $columns));

$style = new Style\BackgroundColor(array(
200,
200,
200
));
foreach ($column_list as $key=>$value) {

   if(!empty($columns)){

if( in_array ( $key , $columns )){
$col = new Column\Select($key, 'u');
$col->setLabel($value);
$dataGrid->addColumn($col);
}
}
else
{
$col = new Column\Select($key, 'u');
$style->addByValue($col, 'pradeep');
$col->setLabel($value);
$col->addStyle($style);
$dataGrid->addColumn($col);
}

}
$aa = new Column\Action\Button();
$aa->setLabel('edit');
$aa->setAttribute('class', 'edit') ;
$actions = new Column\Action();
$actions->setLabel('');
$actions->addAction($aa);

 $dataGrid->addColumn($actions);         
      $dataGrid->render();

return $dataGrid->getResponse();  

here I am using 'toolbarFilters' to access my custom filter data
Here everythig is working fine in HTML report but when I am exporting data in excel or pdf, my custom filters are not working while zfcDatagrid inbuilt column filters are working fine.

Please have a look and let me know if I am missing any syntax.

Thank you.

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.