Git Product home page Git Product logo

grido's People

Contributors

adaamz avatar brabijan avatar ciki avatar djdaca avatar evercool avatar foxycode avatar h4kuna avatar jirinapravnik avatar koprivajakub avatar lookyman avatar martinsifra avatar martyix avatar mordred avatar mstefan21 avatar o5 avatar olicek avatar pavelkouril avatar pepakriz avatar peterpp avatar pkristian avatar pt24 avatar radekuldrych avatar s4muel avatar sasule avatar simara-esports avatar slepic avatar tomaspilar avatar tomasvotruba avatar tvaliasek avatar vojtys 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

Watchers

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

grido's Issues

Vyřízení callbacku "operace" bez redirectu

Pokud si pověsím nějaký callback na "operations" např. "Delete" pro smazání položek, mám problém v tom, že po vyřízení callbacku se Grid snaží jaksi znovuvygenerovat a vyhodí chybu Nette\InvalidStateException:Component with name 'xx' already exists.

V sandboxu se neprojevuje, protože tam je na konci funkce callbacku volán "redirect" - potom k problému nedojde. Ale co kdybych chtěl po vyřízení callbacku grid jen ajaxově invalidovat?

Dík

Add css styles for right and left

Grido already has css class center for centering displayed cells and I suggest to add classes right (especially useful for numbers) and left can be added as well:

.grido .right {text-align: right}
.grido .left {text-align: left}

Opomenutý přepis

V column.php ve funkci setDefaultSorting je špatné volání.

Je

$this->grid->setDefaultSorting(array($this->getName() => strtolower($sorting)));

Má být

$this->grid->setDefaultSort(array($this->getName() => strtolower($sorting)));

Incorrect function in translation

In Grid.php, on line 949

$form->addSelect('count', 'Count', array_combine($this->perPageList, $this->perPageList))
            ->controlPrototype->attrs['title'] = $this->getTranslator()->translate('Items per page');

function does not work correctly. Remains the original text.

In the Czech translation should be "Položek na stránku", but it remains an English version.

Nette 2.1 support

Please add support for the Nette 2.1 (aka dev version). I'm not sure if there are any relevant BC breaks, if not, then it's only a matter of changing composer.json definition.

Filters\Text: Suggest najoinovaného sloupce

Včera jsem zjistil, že v demu přestalo fungovat napovídání sloupce "country".

Napovídá to např.: cz místo Czech Republic.

Došlo k rozdělení presenterů a zárověň záměny názvu sloupce country => country_code, ovšem pouhá změna nazpět problém neřeší, stejně tak nastavení sloupce c.title u filtru.

Začala mě z toho bolet hlava, tak jsem toho raději nechal.. :))

NetteDatabase::getCount()

Při zjišťování počtu záznamů, si zbytečně grida nechává vracet všechny záznamy, díky špatnému volání getCount() ve tříde NetteDatabase.php.

Správně by mělo být:

/**
 * @return int
 */
public function getCount()
{
    return $this->selection->count('*');
}

Export - koncepční zamyšlení

Bylo by fajn umožnit v definici grido výčet možných exportů, resp. export třeba vůbec neumožnit. Mám tím na mysli trochu převorat celý mechanismus exportů:

v metodě

public function setExporting($name = NULL, $type = 'Grido\Export')

by se jako druhý parametr uvádělo pole možných exportů array('csv','xls','pdf' ...) uvedené pořadí by se samořejmě ctilo. Tato metoda by sama nevytvářela novou instanci exportovací třídy, ale ta by se vytvářela až při samotném zpracování požadavku na exportování. V případě, že by se metoda vůbec nevolala, export gridy by se uzivateli neumožnil.

Nutný přepokladem je, že každý exportní formát ($type) by měl být oddělený ve vlastní tříde (teď to tak není).

Je to jen návrh možného řešení, třeba vás napadne něco chytřejšího :-)

Filter vs DataSource: Adaptér

Současný stav je nevyhovující a důvodem je, že Grido bylo stavěno pro Dibi. Takže z gridu lezou condition typu array('([column] = %f)', 3.14); a tedy ostatní drivery (datasource) musí obsahovat metody jako např.: removePlaceholders() apod.

Zatím jsem se tomu do hloubky moc nevěnoval, první krok jsem ale udělal: založil tuto issue :))

Add a columns SUM feature

It would be great to add a columns SUM feature. It can be attached to the grid in the same way as filters are.

Just the last row of the grid would contain sums of the (numerical) columns, specified by user by ->addSum()

From my point of view the funcionality should be sum of the visible rows (when paginator is enabled) or all rows without paginator.

des

feature request: Inline editing...

Hello guys,

I know Grido supports both JS and non-JS modes, but when JS is enabled it would be nice if inline editing could be enabled as well.

My idea is this: When cell is clicked, the cell content of TD tag is saved into some JS variable, then the content is replaced by ajax call for editable element (for example Input text for text field) and onBlur (or onSubmit via Enter) the new value is sent to database and if successful, the original TD content is restored and value is changed via JS/Jquery as well (.value="new value"). If unsuccessful, original TD content is restored but value is not changed (and error can be displayed).
Alternatively the new value may be read from database once saving ajax request is finished but that means additional ajax call. However it may be good for verification.

In case you do not plan to implement this feature, can you point me in the correct direction - how to get particular cell identification so I can hook up events?

Thank you very much,

Jan

Release 1.0.0

TODO:

  • přepsat sestavování condition ve Filtru - 930d9d7 [BC BREAK!]
  • dopsat testy - #13
  • performance - 09bba98 a 1dd30b0
  • odstranit ArrayObjectAccessor::hasProperty() - #43
  • překlopit tests větev do mastera
  • přesunutí závislostí na twitter bootstrap do šablony - #72
  • projít bugy v issues a opravit co je možné
  • RELEASE: 0.9.3 - (verze s E_USER_DEPRECATED)
  • odstranění deprecated věcí - "doklopení" z větve dev
  • RELEASE: 1.0.0 (verze bez E_USER_DEPRECATED)
  • opravit / doplnit dokumentaci

FEATURES:

  • modal editace
  • SUM u sloupců (#57)
  • vylepšení modelů (mám něco v hlavě :) )
  • DI via \Nette\Config\CompilerExtension

TASKS:
1. Verzi (současný tests) s E_USER_DEPRECATED hodit jako 0.9.2?
2. Nějaké další návrhy na přejmenování metod / tříd / BC BREAKY?
3. Připomínky?

DataSources: Přizpůsobení metod bez nutnosti dědit

V návaznosti na tento thread jsem přemýšlel, jak daný problém řešit.

Nechtělo se mi jít otrockou cestou typu:

$grid->dataSourceCallbackMethodGetCount = function() {
        //...
};

Takže mě napadlo následující:

$grid->model->proxy['getCount'] = function(\Grido\DataSources\DibiFluent $dataSource) {
     return $dataSource->fluent->count();
};

//je samozřejmě možné "přetěžovat" všechny metody implementující IDataSource, 
//přičemž argumenty volané z gridu jsou předány jako pole v druhém parametru
$grid->model->proxy['limit'] = function($datasource, $args) {
    $offset = $args[0];
    $limit = $args[1];
    //...
};

To řešení se mi zamlouvá, tak doufám, že se můj postoj časem nezmění :))

Different event processing in filter - text input vs select box

Hi,

grido look like really good tool, but I have one note. In filter of your demo, you have some text inputs and two selects (card and gender). When I write to the text input or pick from the autocomplete results are still same - there is not event for sending filter form, but when I pick from select box filter form is send.

So you have two different behavior of filter fields, so I would recommended to unite :) And for advanced you can do setting for it :) something like "setLiveFilter" - I don't know better name :)

Very good work! Thanks.

Řazení funkcí setDefaultSort - id => DESC

Příklad chyby:

$grid->setDefaultSort(array('id' => 'DESC'));

Po načtení se seřadí správně sestupně dle id, po kliknutí na sloupec id se řazení nezmění na ASC, ale zůstane DESC. Pokud kliknu na jiný sloupec a pak zpět na sloupec id, řazení se provede ASC, po kliku znovu na id se provede řazení DESC, po dalším kliku na id již nadále zůstává DESC. Testováno s Dibi i ORM.

Funkční podoba:

$grid->setDefaultSort(array('id' => 'ASC'));
  • zde se Grido chová korektně

Filtrace dat Nette/Database + PostgreSQL

Zdravim,

uprava funkce removePlaceholders(array $condition) v Grido/DataSources/NetteDatabase funguje pouze pro MySQL. Pro Postgre nefunguje - neakceptuje znak pro uvozeni jmena tabulky. Myslim, ze znak je MySQL specialita. Nejlepsi by podle me bylo zavorky uplne odstranit.

Nebo je pripadne nahrazovat podle driveru ktery Nette/Database pouziva: ` - MySQL, " - Postgre ..atd. Ale to mi prijde zbytecne. Kazda databaze by mela vzit jmeno tabulky bez uvozeni. To se pouziva jen u specialnich nazvu( treba v postgre, kdyz nazev tabulky zacina cislem.. to jsou ale vyjimky).

Paradni grid!

DataSources\Doctrine - Custom condition

Když jsem přidával do sandboxu ukázku Doctrine, zjistil jsem, že driver si nerozumí s custom condition.

Chybu lze nasimulovat přidáním následujícího např. sem.

$grid->addFilterCheck('preferred', 'Only preferred girls :)')
    ->setCondition(Filter::CONDITION_CUSTOM, array(
        TRUE => 'gender = "female" AND centimeters >= 170' //for checked
));

url: http://localhost/grido-sandbox/www/outer/doctrine/default/ajax-off/?grid-filter%5Bpreferred%5D=✓
laděnka: http://goo.gl/42mDT

Podobný problém byl i u Nette\Database.

two FilterCheck issues

Hi guys,

In my desperate attempt to simulate multiselect I came to an idea to do it by using multiple checkboxes with negated conditions and default value true (=checked).

I tried to do it like this:

        $grid->addFilterCheck("state1", "Paid")
            ->setCondition(Filter::CONDITION_CUSTOM, array(
                FALSE => '[state] <> "PAID"'
            ))->changeValue(TRUE);

        $grid->addFilterCheck("state2", "Unpaid")
            ->setCondition(Filter::CONDITION_CUSTOM, array(
                FALSE => '[state] <> "UNPAID"'
            ))->changeValue(TRUE);

        $grid->addFilterCheck("state3", "Cancelled")
            ->setCondition(Filter::CONDITION_CUSTOM, array(
                FALSE => '[state] <> "CANCELLED"'
            ))->changeValue(TRUE);

Here are the issues:

  1. There is no way to set the default value of the check box to True. changeValue does not work and I did not find any other method how to change it.
  2. If I bind my condition to the FALSE value, it does nothing. It only works if I bind it to the TRUE value.

Custom cell renderer

With custom cell renderer it would be possible to assign cell's class/style based on its value.

For example with "checkbox columns" (having values 0/1) which could be colored according to their state. (Coloring the whole row is already possible, but that's not what I need.)

please add addFilterMultiSelect

I just noticed Grido does not support multiselect.

Please add new add addFilterMultiSelect filter to allow to select multiple items by using Nette's MultiSelectBox component. Grido should display rows matching all selected items, so yes - IN SQL operator will make it.

Alternatively you can extend addFilterSelect by adding third parameter indicating multiSelect.

BTW - if you need boostrap css/js multiselect code, I found this:
http://davidstutz.github.io/bootstrap-multiselect/
however any simple multiselect will be fine.

Thank you very much!!!

Bad action links when primary key is zero (falsy)

If you have zero value (or another falsy value, say an empty string) primary key, action links are wrong.

This is caused by code in Grido\Components\Actions::getElement:

    } elseif ($primaryValue) {
        $this->arguments[$primaryKey] = $primaryValue;
        $href = $this->presenter->link($this->getDestination(), $this->arguments);
    }

First, when primary key is zero, empty string or another falsy value, this code branch is not entered. This can be probably fixed by elseif ($primaryValue === NULL).

Second, what types of primary key are supported? Is it OK to assume there is no NULL? (Probably OK in 99.999 % cases.)

Third, if none of these conditions is matched, it silently returns a wrong link. Should an exception be thrown?

Bez definovaných filtrů - pád

Pokud nedefinuji žádné filtry dojde k pádu na řádku 439 v Grid.php:

431:        /**
432:         * @internal
433:         */
434:        public function getFilterRenderType()
435:        {
436:            if ($this->filterRenderType === NULL) {
437:                $this->filterRenderType = Filter::RENDER_INNER; //default
438:    
439:                $filters = $this[Filter::ID]->getComponents();
440:                foreach ($filters as $filter) {
441:                    if (!$this[Column::ID]->getComponent($filter->name, FALSE)) {
442:                        $this->filterRenderType = Filter::RENDER_OUTER;
443:                        break;```

Nová možnost renderování filterů

Líbilo by se mi :), kdyby šlo krom INNER / OUTER renderování filtrů, zvolit i něco jako BOTH, kdy by se filtry, které k sobě mají sloupec renderovali jako INNER a ty co k sobě sloupce nemají by byli jako OUTER.

Export - nazev souboru s apostrofy

Při exportu se špatně generuje název souboru i s apostrofy

v libs\Grido\Components\Export\Export.php

94        $response->setHeader('Content-Disposition', "attachment; filename='{$this->name}.{$this->type}';");

správně má být

94        $response->setHeader('Content-Disposition', "attachment; filename={$this->name}.{$this->type};");

one more FilterCheck issue

Less important FilterCheck issue at the moment - with multiple checkboxes and ajax enabled and with slower connection/server, after the clicking on first checkbox, user can click on other checkboxes before first ajax request is finished.

This causes user's second request beeing reverted back (i.e. checked checkbox is suddenly unchecked). Such a behavriour with multiple checkboxes looks chaotic and can confuse the user.

(One solution would be to disable checkboxes whilst any ajax request is running, other to do ajax only after button click, or another to not to re-draw filter section after check box is changed - only the datagrid ... Each of them has some drawbacks...)

HrefAction with custom renderer has no href attribute

Hi,
if I add simple custom renderer to action, rendered element has no href attribute. See code below:

$grid->addActionHref('action', "Don't do it!")
  ->setIcon('ban-circle')
  ->setCustomRender(function($item, \Nette\Utils\Html $el) {
    return $el;
  })

Opera XLS export bug

Grido generates strange filename while trying to export files in Opera. It appears in chinese characters. Any idea what could be wrong? Other browsers work fine.

Export - setReplacement

V exportu se nezohlednuje Column::setReplacement(), tedy se nenahrazují hodnoty preferovanými.

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.