1

i making nette component like DataGrid. I have one basecomponent BaseGrid. In this component i calling another component Filter

    public function createComponentFilter()
        {
            return new Multiplier(function ($columnName) {
                return new \App\Filter\FilterControl($columnName, $this->session, $this->database);
            });
        }

where $columnName is name of column (How unexpected)

Constructor of component Filter

    public function __construct($column_name, Session $session, $database)
    {
        $this->session = $session;
        $this->sessionSection = $this->session->getSection('filtr');
        $this->column_name = $column_name;
        $this->database = $database;
    }

In component filter i have ajax form and after sending this ajaxform i need to transmit string from form to render method of component Datagrid.

I tried sessions of course with redrawControl. But nothing happend. Is there some possible solution? Like session, persistent params, magic rainbow unicorns, or better little fluffy cats with tomatoes pizzas at back.

Thanks lot for ideas.

1 Answers1

0

I'm not quite sure what are you looking for, but..

It could be Dynamic Snippets.

https://doc.nette.org/en/2.3/ajax#toc-dynamic-snippets

{snippet items}
    {foreach $items as $item}
        {snippet "items-" . $item->id}
            {$item->str}
        {/snippet}
    {/foreach}
{/snippet}    

You could redraw only one item, e.q.

$this->redrawControl("item-$id");

If this not help you. Please provide more code, especially latte template.

Felix
  • 217
  • 1
  • 3
  • 10