Skip to content

Commit

Permalink
Merge pull request #107 from dansysanalyst/multiple_components_per_page
Browse files Browse the repository at this point in the history
Add multiple components per page
  • Loading branch information
dansysanalyst authored May 21, 2024
2 parents cc45704 + c0a4a63 commit 9cce28f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/get-started/rendering-a-powergrid-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ For reference, the following example utilizes the class `app/Livewire/Tables/Dis
<livewire:tables.dish-table /> // [!code ++]
```

## Multiple Components Per Page

To display more than one PowerGrid component you must first set a unique `TableName` to each component. Read more about [configuring table name](/table-component/component-configuration.html#table-name).

In order to have pagination on each component, you may also need to configure an unique "page=" parameter for each component. Read more about [configuring Page Parameter](/pagination.html#url-page-parameter).

Then, you can just include two `<livewire>` tags as demonstrated below.

```php
// resources/views/my-view.blade.php

<livewire:dish-table/> // [!code ++:3]

<livewire:user-table>
```

## Component Attributes

### Passing Attributes
Expand All @@ -60,7 +76,7 @@ In the next example, we are passing the [`tableName`](/table-component/component

<livewire:dish-table tableName="DishTable" /> // [!code ++:3]

<livewire:dish-table tableName="UserTable" />
<livewire:tuser-table tableName="UserTable" />
```

### Passing Custom Attributes
Expand Down

0 comments on commit 9cce28f

Please sign in to comment.