Skip to content

Commit

Permalink
Fixed #5123 - DataTable: body template rowTogglerCallback callback op…
Browse files Browse the repository at this point in the history
…tion added
  • Loading branch information
tugcekucukoglu committed Jan 22, 2024
1 parent e3d9f41 commit f9117be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/lib/column/Column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,15 @@ export interface ColumnSlots {
*/
frozenRow: boolean;
/**
* Callback function
* Editor init callback function
* @param {Event} event - Browser event
*/
editorInitCallback: (event: Event) => void;
/**
* Row toggler callback unction
* @param {Event} event - Browser event
*/
rowTogglerCallback: (event: Event) => void;
}): VNode[];
/**
* Custom header template.
Expand Down
12 changes: 11 additions & 1 deletion components/lib/datatable/BodyCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@
:data-p-frozen-column="columnProp('frozen')"
>
<span v-if="responsiveLayout === 'stack'" :class="cx('columnTitle')" v-bind="getColumnPT('columnTitle')">{{ columnProp('header') }}</span>
<component v-if="column.children && column.children.body && !d_editing" :is="column.children.body" :data="rowData" :column="column" :field="field" :index="rowIndex" :frozenRow="frozenRow" :editorInitCallback="editorInitCallback" />
<component
v-if="column.children && column.children.body && !d_editing"
:is="column.children.body"
:data="rowData"
:column="column"
:field="field"
:index="rowIndex"
:frozenRow="frozenRow"
:editorInitCallback="editorInitCallback"
:rowTogglerCallback="toggleRow"
/>
<component
v-else-if="column.children && column.children.editor && d_editing"
:is="column.children.editor"
Expand Down

0 comments on commit f9117be

Please sign in to comment.