Hi,
I am using below method to collapse a Cell
function collapse(n) {
if (fieldsToExpand.length == 0) {
let slice = pivot.getReport().slice
fieldsToExpand = slice.rows.splice(-n)
pivot.runQuery(slice)
}
}
But it seems that its not taking filters added on Rows and thus providing incorrect result. How can we fix it?
Thanks,
Varun
Hello, Varun!
Thank you for reaching out to us.
Kindly note that Flexmonster has a built-in API for collapsing and expanding cells. Our team recommends using collapseCell() to collapse the cell programmatically. To expand it again, you can use expandCell(). You may also find the getCell() method helpful for retrieving information about the cell tuple by its row and column indexes.
Regarding your question about the lost filters, please note that the filters are stored in the field object in slice.rows. If the field object is removed by splice(-n), the filters are gone as well. When using collapseCell(), the fields stay in the slice, and their filters remain applied. With this in mind, we suggest trying the built-in API as a first step. If the collapseCell() is not feasible for your use case, please provide us with more details on the case.
Looking forward to hearing your feedback.
Kind regards,
Solomiia
Hi Solomiia,
Thanks for sharing the detailed info. We found a solution for it . You can close the ticket.
Hello, Varun!
Thank you for your feedback.
Our team is happy that the case is resolved.
Feel free to reach out to us if any other questions arise.
Kind regards,
Solomiia