Closed markusdobler closed 8 months ago
Clicking on a sortable header in a CvDataTable (e.g. the first two columns in the official story book didn't actually trigger the expected events:
order: undefined
The code that emits cv:sort when clicking on a CvDataTableHeading uses the key value:
cv:sort
CvDataTableHeading
value
function onSortClick() { bus?.emit('cv:sort', { heading: { id: cvId.value, name: props.name }, value: nextOrder[internalOrder.value], }); }
However, the receiving code destructs payload into a variable named val:
payload
val
function onSort(payload) { const { heading, val } = payload;
As val doesn't acutally exist in the payload, the variable gets initialized to undefined, breaking the rest of that function.
undefined
Changed the code in onSort(payload) to use the variable named value instead of val.
onSort(payload)
onSort
order
Thanks for the fix!
What was broken?
Clicking on a sortable header in a CvDataTable (e.g. the first two columns in the official story book didn't actually trigger the expected events:
order: undefined
Why ?
The code that emits
cv:sort
when clicking on aCvDataTableHeading
uses the keyvalue
:However, the receiving code destructs
payload
into a variable namedval
:As
val
doesn't acutally exist in the payload, the variable gets initialized toundefined
, breaking the rest of that function.What did you do?
Changed the code in
onSort(payload)
to use the variable namedvalue
instead ofval
.How have you tested it?
onSort
action now has the properorder
Were docs updated if needed?