Livewire Powergrid getting error: Alpine Expression Error: window.pgBulkActions is undefined when using bulk action

I have a Laravel 11 installation with Livewire 3 and I wanted to add PowerGrid latest to the stack. I am new for Livewire, I followed the instructions of the Livewire Powergrid documentation. I have created data table all stuff is working fine rendring, filter, pagination etc, But When try to impliment bulk action getting error Alpine Expression Error: window.pgBulkActions is undefined. Power grid store all ids in this global variable.

Alpine comes as default with Laravel LiveWire 3, so I did not need to install separately, so it is should not be a the cause of the error

I have made a component using this command :

php artisan powergrid:create

with auto Eloquent BComponentuilder, Auto-Discover Models and fillable property

This is the code of Component class OrderItemQuantityTable::

`

<?php

namespace AppLivewire;

use AppModelsDepartment;
use AppModelsOrderItemQuantity;
use IlluminateDatabaseEloquentBuilder;
use IlluminateSupportFacadesLang;
use PowerComponentsLivewirePowerGridButton;
use PowerComponentsLivewirePowerGridColumn;
use PowerComponentsLivewirePowerGridFacadesFilter;
use PowerComponentsLivewirePowerGridFooter;
use PowerComponentsLivewirePowerGridHeader;
use PowerComponentsLivewirePowerGridPowerGrid;
use PowerComponentsLivewirePowerGridPowerGridFields;
use PowerComponentsLivewirePowerGridPowerGridComponent;
use LivewireAttributesOn;

final class OrderItemQuantityTable extends PowerGridComponent
{
    public bool $showFilters = false;

    public bool $deferLoading = true;

    public string $tableName = 'order_item_quantities';

    public int $stage = 0;

    public function setUp(): array
    {
        $this->showCheckBox();

        return [
            Header::make()->showSearchInput(),
            Footer::make()
                ->showPerPage()
                ->showRecordCount(),
        ];
    }

    public function header(): array
    {
        return [
            Button::add('bulk-delete')
                ->slot('Bulk delete (<span x-text="window.pgBulkActions.count('' . $this->tableName . '')"></span>)')
                ->class('pg-btn-white dark:ring-pg-primary-600 dark:border-pg-primary-600 dark:hover:bg-pg-primary-700 dark:ring-offset-pg-primary-800 dark:text-pg-primary-300 dark:bg-pg-primary-700')
                ->dispatch('bulkDelete.' . $this->tableName, []),
        ];
    }

    public function datasource(): Builder
    {
        return OrderItemQuantity::query()->with('department')
            ->when(
                $this->stage,
                fn ($builder) => $builder->whereHas(
                    'department',
                    fn ($builder) => $builder->where('stage', $this->stage)
                )
            );
    }

    public function relationSearch(): array
    {
        return [
            'department' => [
                'name',
            ],
        ];
    }

    public function fields(): PowerGridFields
    {
        return PowerGrid::fields()
            ->add('id')
            ->add(OrderItemQuantity::MAGENTO_ORDER_ID)
            ->add(OrderItemQuantity::MAGENTO_ITEM_ID)
            ->add(OrderItemQuantity::SKU)
            ->add(OrderItemQuantity::QUANTITY, fn ($orderItemQuantity) => OrderItemQuantity::ITEM_QTY_VIEW_PREFIX.$orderItemQuantity->{OrderItemQuantity::QUANTITY})
            ->add(OrderItemQuantity::DEPARTMENT_ID, fn ($orderItemQuantity) => intval($orderItemQuantity->{OrderItemQuantity::DEPARTMENT_ID}))
            ->add('department_name', fn ($orderItemQuantity) => $orderItemQuantity->{OrderItemQuantity::DEPARTMENT_ID} ? $orderItemQuantity->department->{Department::NAME} : '')
            ->add(OrderItemQuantity::STATUS, fn ($orderItemQuantity) => $orderItemQuantity->{OrderItemQuantity::STATUS} ? OrderItemQuantity::PROCESSING_STAGE_STATUS_OPTION[$orderItemQuantity->{OrderItemQuantity::STATUS}] : '');
    }

    public function columns(): array
    {
        return [
            Column::make('Id', 'id')->sortable(),
            Column::make(Lang::get('common.magento_order_id'), OrderItemQuantity::MAGENTO_ORDER_ID)
                ->sortable()
                ->searchable(),

            Column::make(Lang::get('common.magento_item_id'), OrderItemQuantity::MAGENTO_ITEM_ID)
                ->sortable()
                ->searchable(),

            Column::make(Lang::get('common.sku'), OrderItemQuantity::SKU)
                ->sortable()
                ->searchable(),

            Column::make(Lang::get('common.quantity'), OrderItemQuantity::QUANTITY),

            Column::make(Lang::get('common.department'), 'department_name'),

            Column::make(Lang::get('common.status'), OrderItemQuantity::STATUS),

            Column::action(Lang::get('common.action'))
        ];
    }

    public function filters(): array
    {
        return [
            Filter::inputText(OrderItemQuantity::SKU)
                ->operators(['contains'])
                ->placeholder(Lang::get('common.sku')),

            Filter::inputText(OrderItemQuantity::MAGENTO_ORDER_ID)
                ->operators(['contains'])
                ->placeholder(Lang::get('common.magento_order_id')),

            Filter::inputText(OrderItemQuantity::MAGENTO_ITEM_ID)
                ->operators(['contains'])
                ->placeholder(Lang::get('common.magento_item_id')),

            Filter::select('department_name', OrderItemQuantity::DEPARTMENT_ID)
            ->dataSource(Department::all())
            ->optionLabel('name')
            ->optionValue('id'),

            Filter::select(OrderItemQuantity::STATUS, OrderItemQuantity::STATUS)
            ->dataSource(OrderItemQuantity::PROCESSING_STAGE_STATUS_OPTION_GRID)
            ->optionLabel('name')
            ->optionValue('id'),
        ];
    }

    #[On('edit')]
    public function edit($rowId): void
    {
        $this->js('alert('.$this->tableName.')');
    }

    public function actions(OrderItemQuantity $row): array
    {
        return [
            Button::add('edit')
                ->slot('Edit: '.$row->id)
                ->id()
                ->class('pg-btn-white dark:ring-pg-primary-600 dark:border-pg-primary-600 dark:hover:bg-pg-primary-700 dark:ring-offset-pg-primary-800 dark:text-pg-primary-300 dark:bg-pg-primary-700')
                ->dispatch('edit', ['rowId' => $row->id])
        ];
    }

    #[On('bulkDelete.{tableName}')]
    public function bulkDelete(): void
    {
        $this->js('alert(window.pgBulkActions.get('' . $this->tableName . ''))');
    }

    /*
    public function actionRules($row): array
    {
    return [
            // Hide button edit for ID 1
            Rule::button('edit')
                ->when(fn($row) => $row->id === 1)
                ->hide(),
        ];
    }
    */
}

`

This is the error which I get in console ::

I tried to get as much info about this error as I could, but found none of valuable one.

Anyone, any idea?

Thank you!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật