leantony / laravel-grid

A grid view for laravel, inspired by the yii2 grid widget
https://leantony.github.io/laravel-grid/
MIT License
91 stars 39 forks source link

problem search #96

Open rezasrk opened 5 years ago

rezasrk commented 5 years ago

the search not working when use left join in query

in UserController

public function view(UsersGridInterface $usersGrid,Request $request) { $query = User::query()->leftjoin('persons','prs_usr_id','=','id'); return $usersGrid->create(['query'=>$query,'request'=>$request]) ->renderOn('users.view'); }

in UsersGrid

` public function setColumns() { $this->columns = [ "id" => [ "label" => "id",

            "filter" => [
                "enabled" => true,
                "operator" => "="
            ],
            "styles" => [
                "column" => "grid-w-10"
            ]
        ],
        "username" => [
            "label" => "username",
            "search" => [
                "enabled" => true
            ],
            "filter" => [
                "enabled" => true,
            ]
        ],
        "prs_name" => [
            "label" => "full_name",
            "search" => [
                "enabled" => true
            ],
            "filter" => [
                "enabled" => true,
                "operator" => "="
            ]
        ],
    ];
}

`

basicAngular commented 5 years ago

Same problem with me i am not able to search, correct data.

basicAngular commented 5 years ago

@rezasrk had you found any solutions?

rezasrk commented 5 years ago

@rezasrk had you found any solutions?

hi no