You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -396,6 +396,79 @@ cd custom
396
396
npm i @iconify-prerendered/vue-mdi
397
397
```
398
398
399
+
## List table row replace injection
400
+
401
+
`tableRowReplace` lets you fully control how each list table row is rendered. Instead of the default table `<tr>…</tr>` markup, AdminForth will mount your Vue component per record and use its returned DOM to display the row. Use this when you need custom row layouts, extra controls, or conditional styling that goes beyond column-level customization.
402
+
403
+
Supported forms:
404
+
- Single component: `pageInjections.list.tableRowReplace='@@/MyRowRenderer.vue'`
405
+
- Object form with meta: `pageInjections.list.tableRowReplace= { file:'@@/MyRowRenderer.vue', meta: { /* optional */ } }`
406
+
- If an array is provided, the first element is used.
407
+
408
+
Example configuration:
409
+
410
+
```ts title="/resources/apartments.ts"
411
+
{
412
+
resourceId:'aparts',
413
+
...
414
+
options: {
415
+
pageInjections: {
416
+
list: {
417
+
tableRowReplace: {
418
+
file:'@@/ApartRowRenderer.vue',
419
+
meta: {
420
+
// You can pass any meta your component may read
421
+
}
422
+
}
423
+
}
424
+
}
425
+
}
426
+
}
427
+
```
428
+
429
+
Minimal component example (decorate default row with a border):
- `meta`: the meta object passed in the injection config
455
+
- Slots
456
+
- Default slot: the table’s standard row content (cells) will be projected here. Your component can wrap or style it.
457
+
- Output
458
+
- Render a full `<tr>…</tr>` fragment. For example, to replace the standard set of cells with a single full‑width cell, render:
459
+
460
+
```vue
461
+
<tr>
462
+
<td :colspan="columnsCount">
463
+
<slot />
464
+
</td>
465
+
</tr>
466
+
```
467
+
468
+
Notes and tips:
469
+
- Requirements:
470
+
- Required `<tr></tr>` structure around `<slot />`
471
+
399
472
## List table beforeActionButtons
400
473
401
474
`beforeActionButtons` allows injecting one or more compact components into the header bar of the list page, directly to the left of the default action buttons (`Create`, `Filter`, bulk actions, three‑dots menu). Use it for small inputs (quick search, toggle, status chip) rather than large panels.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/07-Plugins/03-ForeignInlineList.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ If you need to add default filters for the foreign resource based on your curren
121
121
>👆It also makes sense to modify the table resource and hide the country field from filters, because this value is hardcoded and equals the country from the record:
122
122
123
123
124
-
```ts
124
+
```ts title="./resources/adminuser.ts"
125
125
126
126
...
127
127
@@ -165,3 +165,26 @@ If you need to add default filters for the foreign resource based on your curren
165
165
...
166
166
167
167
```
168
+
169
+
170
+
## Show table from another resource without any filters applied
171
+
172
+
There might be cases when you want to remove the default filter applied by the plugin and then use the `defaultFilters` callback to apply your own custom filters.
173
+
174
+
```ts title="./resources/adminuser.ts"
175
+
176
+
plugins: [
177
+
//diff-add
178
+
newForeignInlineListPlugin({
179
+
//diff-add
180
+
foreignResourceId: 'aparts',
181
+
//diff-add
182
+
disableForeignListResourceRefColumn: true
183
+
//diff-add
184
+
}),
185
+
//diff-add
186
+
],
187
+
188
+
```
189
+
190
+
This setup will show, in the show view for each record, the `aparts` resource without any filters. And you don’t have to modify the `aparts` resource.
0 commit comments