Fixed #5123 - DataTable: body template rowTogglerCallback callback option added

pull/5128/head
tugcekucukoglu 2024-01-22 10:50:59 +03:00
parent e3d9f41926
commit f9117be895
2 changed files with 17 additions and 2 deletions

View File

@ -684,10 +684,15 @@ export interface ColumnSlots {
*/ */
frozenRow: boolean; frozenRow: boolean;
/** /**
* Callback function * Editor init callback function
* @param {Event} event - Browser event * @param {Event} event - Browser event
*/ */
editorInitCallback: (event: Event) => void; editorInitCallback: (event: Event) => void;
/**
* Row toggler callback unction
* @param {Event} event - Browser event
*/
rowTogglerCallback: (event: Event) => void;
}): VNode[]; }): VNode[];
/** /**
* Custom header template. * Custom header template.

View File

@ -18,7 +18,17 @@
:data-p-frozen-column="columnProp('frozen')" :data-p-frozen-column="columnProp('frozen')"
> >
<span v-if="responsiveLayout === 'stack'" :class="cx('columnTitle')" v-bind="getColumnPT('columnTitle')">{{ columnProp('header') }}</span> <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 <component
v-else-if="column.children && column.children.editor && d_editing" v-else-if="column.children && column.children.editor && d_editing"
:is="column.children.editor" :is="column.children.editor"