DataTable - Conditional Expander #2977
Unanswered
mkalinski93
asked this question in
PrimeVue
Replies: 1 comment
-
Hello @mkalinski93. You can actually expand some rows by default. If you look at this example. There is a ref that tracks the expanded rows: ... more code
const products = ref();
const expandedRows = ref({});
onMounted(() => {
ProductService.getProductsWithOrdersSmall().then((data) => {
products.value = data;
expandedRows.value = data.reduce((acc, product) => {
if (product.price > 100) {
acc[product.id] = true;
}
return acc;
}, {});
});
});
... more code |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I just wanted to ask if there´s an inbuilt method that I can show/hide the row expander conditionally.
If there´s no provided method, would something like that be possible?
Beta Was this translation helpful? Give feedback.
All reactions