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

create onSearch in CreateController #84

Closed
bjverde opened this issue Mar 26, 2022 · 1 comment
Closed

create onSearch in CreateController #84

bjverde opened this issue Mar 26, 2022 · 1 comment
Labels

Comments

@bjverde
Copy link
Owner

bjverde commented Mar 26, 2022

include search orm adianti on CreateController

Depende de:

Related with:

@bjverde
Copy link
Owner Author

bjverde commented Oct 7, 2023

Exemplo de código

    /**
     * Register the filter in the session
     */
    public function onSearch($param = null)
    {
        $data = $this->form->getData();
        $filters = [];

        TSession::setValue(__CLASS__.'_filter_data', NULL);
        TSession::setValue(__CLASS__.'_filters', NULL);

        $filters = OrmAdiantiHelper::addFilter($filters,'nome','like',$data->nome,null);
        $filters = OrmAdiantiHelper::addFilter($filters,'ddi' ,'='   ,$data->ddi ,null);
        $filters = OrmAdiantiHelper::addFilter($filters,'ddd' ,'='   ,$data->ddd ,null);
        $filters = OrmAdiantiHelper::addFilter($filters,'celular' ,'like'   ,$data->celular ,null);

        FormDinHelper::debug($filters);

        // fill the form with data again
        $this->form->setData($data);

        // keep the search data in the session
        TSession::setValue(__CLASS__.'_filter_data', $data);
        TSession::setValue(__CLASS__.'_filters', $filters);

        $this->onReload(['offset' => 0, 'first_page' => 1]);
    }

@bjverde bjverde changed the title include search orm adianti on CreateController create onSearch in CreateController Oct 7, 2023
bjverde added a commit that referenced this issue Oct 7, 2023
bjverde added a commit that referenced this issue Oct 7, 2023
bjverde added a commit that referenced this issue Oct 8, 2023
@bjverde bjverde closed this as completed Oct 8, 2023
@bjverde bjverde added the Backend label Oct 8, 2023
bjverde added a commit that referenced this issue Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant