deniskoronets / Laravel-GridView

Laravel package which allows to render cool tables
https://deniskoronets.github.io/Laravel-GridView/
20 stars 7 forks source link

Tables not shown after updating to v2.3 #50

Open farouqariff opened 8 months ago

farouqariff commented 8 months ago

I come from v2.2 and I implement it on my Laravel project. I don't know why but after updating to v2.3 suddenly the tables were not able to displayed. When I check on Inspect page, it said "app.js:17 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.". Hope Mr. Denis can help me on solving this issue.

deniskoronets commented 7 months ago

we don't have 2.3. Latest stable version is v.2.2. Do you use vuejs in your project?

farouqariff commented 7 months ago

Because when I composer update, suddenly I got this message, "- Installing woo/laravel-grid-view (2.3): Extracting archive" so I thought that the package has been updated and that was why like suddenly the table was not displayed with Vue warn message. After that, even after downgrading or like specifying the version at composer.json, it still do not fix the issue. In my project, we don't use vuejs, we are only using Laravel 9 with PHP 8.1.6 .

SunnnyGohil commented 6 months ago

I have vue js on my project and i am facing same issue

SunnnyGohil commented 6 months ago

@farouqariff did you fixed the issue? If yes then please write here.

deniskoronets commented 6 months ago

@SunnnyGohil this gridview uses vue for rendering. If you have your gridview rendered within vue-handled component you might get vue warning that it doesn't support script inject into vue component.

if you have the following error please try out creating your grid with 'standaloneVue' => true in your config and registering this component in your vue instance: https://github.com/deniskoronets/Laravel-GridView/blob/master/resources/js/GridView.vue

deniskoronets commented 6 months ago

or please provide some detailed screenshots/logs of error so I could assist you

SunnnyGohil commented 6 months ago

[ Screenshot from 2024-05-01 22-36-21 ]

received this error in console

SunnnyGohil commented 6 months ago

use App\Models\User;
?>
@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">{{ __('Users') }}</div>
            <div class="pull-right" style="margin:5px;">
                <a class="btn btn-success" href="{{ route('users.create') }}"> Create New User</a>
            </div>
    @if ($message = Session::get('success'))
        <div class="alert alert-success">
            <p>{{ $message }}</p>
        </div>
    @endif

@grid([
    'dataProvider' => $dataProvider,
    'columns' => [
        [
            'class' => 'raw',
            'title' => 'Name',
            'value' => function($data){
                return $data->name;

            },
        ],
        [
            'class' => 'raw',
            'title' => 'Email',
            'value' => function($data){
                return $data->email;

            },
        ],
        [
            'class' => 'raw',
            'title' => 'Status',
            'value' => function($data){
                return $status= isset(User::getUserStatus()[$data->status])?User::getUserStatus()[$data->status]:"";

            },
        ],
        [
            'class' => 'raw',
            'title' => 'WorkPlace Status',
            'value' => function($data){
                return $status= isset(User::getUserStatus()[$data->wp_status])?User::getUserStatus()[$data->wp_status]:"";

            },
        ],
        [
            'class' => 'actions',
            'value' => [
                'edit:/users/{id}/edit', // {id} - will be replaced with an attribute from row
                'delete:/users/{id}/destroy', // {id} - will be replaced with an attribute from row
            ]
        ]
    ]
])

@endsection

this is the my code

farouqariff commented 6 months ago

@farouqariff did you fixed the issue? If yes then please write here.

I replace this package with laravel-grid-view by itstructure.. https://github.com/itstructure/laravel-grid-view

SunnnyGohil commented 6 months ago

@farouqariff

thanks for the suggestion I will update.