GithubHelp home page GithubHelp logo

apydatagridbundle's People

Contributors

artscorestudio avatar b-durand avatar boekkooi avatar cordoval avatar darnel avatar daum avatar deguif avatar delirehberi avatar doncallisto avatar eugene1g avatar hmert avatar ip512 avatar jan0707 avatar lstrojny avatar michelpa avatar mlledelphine avatar npotier avatar ousamabenyounes avatar patgrudniewski avatar pierredup avatar plfort avatar qferr avatar rgarcia-martin avatar romainguerrero avatar slimus avatar sorien avatar stanislavprokopov avatar sterrien avatar tomcyr avatar yazbahar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apydatagridbundle's Issues

How can we had a custom filter

It would be nice if we can had buttons or a comboboxes to perform in one click simple or complex filters.

Exemple : Lets say you have three columns, first name, last name and country.

A combobox could propose to filter on the first and the country.

<select>
  <option value="??">first=igor and country=EN</option>
  <option value="??">first=igor</option>
  <option value="??">last=gonzola</option>
</select>

Do you think this is already possible ?

Incorrect namespace in readme.md

From:
use Sorien\DataGridBundle\Source\Entity;
use Sorien\DataGridBundle\Source\Document;

To:

use Sorien\DataGridBundle\Grid\Source\Entity;
use Sorien\DataGridBundle\Grid\Source\Document;

Filtering many-to-one columns

Getting the following error when adding a filter to many-to-one columns:

An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 845: Error: Expected =, <, <=, <>, >, >=, !=, got 'as'") in MyBundle:MyController:index.html.twig at line 67.

Problem, or simply not implemented?

Thanks

move prepare function to twig

when you are setting grid to template you are calling

$this->render('Foo:Page:index.html.twig', array('data' => $grid->prepare()));

new way can be

$this->render('Foo:Page:index.html.twig', array('data' => $grid));

and twig will call function prepare for you when you are drawing grid

<!- twig ->
grid(data, _self) will call prepare() function for data

its ok for all?

Multiple grids?

Hi!

i have tested youre grid in my app and its a wonderfull bundle, but i have problems with multiple grids on the same page and i doesent know what's wrong.

$grid = $this->get('grid');

// First Grid
$grid->setId('grid1');
$source = new Entity(OneEntity);
$grid->setSource($source);

// And now the second:

$grid->setId('grid2');
$source = new Entity(SecondEntity);
$grid->setSource($source);

Error: Source can be set just once

I'm not sure if I understood this function correctly?

I hope you can get me a short tip.

Thanks for your time.

Don't use another route to filter

I think the grid shouldn't call another route to filter data.

Could we just add a query parameter to tell that the grid must is filtered ?
Or look at the grid hash in the query string of the url or in the session ? ( If the hash of the grid exist with the primary column, the grid is filtered. )

What do you think ?

RangeColumn, From: and To: are not translated

It would be nice if "From:" and "To:" for the RangeColumn Type could be translatable by the Translator.

I would try to implement it myself but i dont actually know how to inject or access the translator service in this context.

It might be a good idea to transform that render constructions into customizable Twig-Templates as well..

Double mass action checkboxes

Weird issue. I am creating a grid as follows:

    $grid = $this->get('grid');
    $grid->addMassAction(new DeleteMassAction());
    $grid->setSource(new Entity('MyCandidateBundle:Candidate'));
    $grid->addRowAction(new RowAction('Show', 'candidate_show'));
    $grid->addRowAction(new RowAction('Edit', 'candidate_edit'));

Works fine, yet it creates two checkboxes to the left of each row.

data() function don't work on Twig 1.2.0 and Symfony 2.0.5

After update twig ans symfony, the datagrid bundle stopped working. It display the message:

An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 77: Error: Expected =, <, <=, <>, >, >=, !=, got '('") in "GestorSistemaBundle:Country:index.html.twig" at line 1.

There is only one line on my template:

{{ grid(data) }}

The template don't extends any other template.

Problem with Mappings

Hello,

I have problem getting this thing to run. Not quite sure why but i have the impression there is a problem with the mapping of object members to database fields.

When launching the grid route symfony throws an exception: "No mapping found for field 'created_by' on class 'ProductBundle\Entity\Product'.

In my project I use annotations for the field definitions. 'created_by' is the name of the database field which is 'createdBy' in the object.

Any clue?

Thank you

Manipulate QueryBuilder

First of all, thanks for the bundle, really awesome :)

I created the doctrine2 source in zfdatagrid and I wondered if it is possible to manipulate the QueryBuilder so that I can limit the rows that will be shown in the grid, maybe by adding some getter to the Grid/Source/Entity class!?

Let me know if I can help you there ;)

Add a row actions column

Add a column for row actions with the same actions of the mass action select, or not.

Plus, we can add icons before each action name, or instead of the name. And we can add these icons in the select of mass action. New internet browsers handle pictures in select tag.

We can use this implementation :

$actions->addAction(array(
    'name' => 'Delete', 
    'callback' =>'YourProject\YourBundle\Controller\YourControllerClass::yourDeleteMethod'
    'isMassAction' => true
    'isRowAction' => true
    'icon' => 'pathToThePicture'
    )
);

If there is at less one column with the flag isMassAction, the select is visible.
If there is at less one column with the flag isRowAction, the column row action is visible.

What do you think ? I like this Enhancement

Parameter `id` can't be used in annotations for property `xyz`

Receiving the above error when trying to render ManyToOne columns.. For example in my UserBundle:

/**
 * @ORM\ManyToOne(targetEntity="MyApp\CompanyBundle\Entity\Company")
 * @ORM\JoinColumn(name="company_id", referencedColumnName="id")
 * @Grid\Column(id="company.name", title="Current Employer", filterable=true, visible=true)
 */
protected $company;

Could this be because I am joining across bundles (UserBundle -> CompanyBundle)?

Permanent parameters for route

Hi,

i have a short feature request.

I think its a good idea to bring in a method for extra params that will append to the generated routes.

A short example:

// controller
$grid->addExtraParams(array('x' => 1));

// Grid.php
public function getRouteUrl()
$this->router->generate($this->request->get('_route'), $this->getExtraParams());

So we can add some extra params to the routes, i think it's a nice feature.

data saving and binding request data

its done automatically when source is set but there should be a own function save() and bindData() or something like this

$grid = get('grid')->set(new Source());
$grid->bindData();

if ($grid->isRedirectNeeded())
{
$grid->save();
//redirect
}
else
{
//render view
$grid->prepare();
}

any ideas how should it work?

Add a new boolean column

We can add a new type column, a boolean column.
Perhaps this column can extend the select column.

The filter propose true, false or undefined.
And the row is rendering with pictures.

Rendering a grid with PHP template engine?

The documentation is clear on how to use the DataGrid bundle with Twig. Does it work with PHP as the template engine? Is something like this possible?

<?php
$source = new Entity('AcmeDemoBundle:MyEntity');
$grid = $this->get('grid');
$grid->setSource($source);

// ...

<?php echo $grid->renderHtml() ?>

template inheritance

block inheritance in twig has changed in stable version ... it was partially fixed but you can extend template just once (one level) ... this need proper fix for multiple levels

Pager disappears

The pager disappears when you choose a limit greater than the number of results.
After this change, we can no longer set another limit.

(limit = items per page)

use block from current template

use blocks from current twig template where grid() is called instead of defining another template like grid(data, 'custom_template') ... something like grid(data, _self)

grid configuration

we could create grid configuration in base config like

datagrid:
    template: YourBaseTemplate

or

datagrid:
    grids:
        mygrid:
            id: 'foo'
            limits: {20: '20', 100:'100', 0:'all'}
            source: {type: 'entity', name:'Blog::Pages'}

and in controller you can call just this->get('grid.mygrid') and you will get grid with all settings

Row action allow/disallow based on column value

Hi,

is search for a way to enable or disable a row action based on a column value, for example:

column: isfresh = 1 -> allow UpdateAction for this row in grid
column: isfresh = 0 -> disallow/hide UpdateAction for this row in grid

What's the right way for this szenario?

I hope anyone can help, thanks and a nice weekend.

Right way to integrate extra columns into grid?

Hi,

i search for the right way to bring in some extra columns into my grid.

My first example is a simple image column, like "src/folder/{{ row.id }}.jpg".
I am not sure what's the right way for this, i hope anyone can get me a short tipp?

My second problem are columns with a ManyToOne situation:

 * @GRID\Source(columns="id, name, category")
 */
class MyClass
{
....
     * @GRID\Column(id="category.name", title="category", field="category")
     */
    protected $category;

But my column category does not work/display in my grid with this configuration.

I hope anyone can help?

Thanks!

Filter redirection doesn't handle route parameters.

If I remove the id parameter from the route and the indexAction function the grid renders without an error.

Symfony: 2.0.5
Twig: 1.1.2.

URL: http://localhost/proj/app_dev.php/default/1

Route:

AcmeTestBundle_default:
    pattern:  /default/{id}
    defaults: { _controller: AcmeTestBundle:Default:index }

Controller:

namespace Acme\TestBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sorien\DataGridBundle\Grid\Source\Entity;

class DefaultController extends Controller
{    
    public function indexAction($id)
    {   
        $source = new Entity('AcmeTestBundle:Sample');
        $grid = $this->get('grid');
        $grid->setSource($source);       
        return $this->render('AcmeTestBundle::test.html.twig', array('data' => $grid));
    }
}

Template:

{{ grid(data) }}

getTotalCount and groupBy

When using groupBy in the query, the method Entity#getTotalCount fails with a "NonUniqueResultException".

Example:

<?php
$source->setCallback(Source::EVENT_PREPARE_QUERY, function($qb)  {
    $qb->groupBy(Entity::TABLE_ALIAS .'.id');
});

Define a random id by default.

I think it's better to define for each new grid a unique Id.
With these auto generated Id we don't have to define our own id for each grid when we use multiple grids on the same page.
It'll be easier to use, don't you think?

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.