This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal. |
This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal. |
You can set empty data to segment. For example your segment name is segProducts then
use the below code to clear the data.
var emptyData =[];
this.view.segProducts.setData(emptyData);
Hi,
I tried it like this, but didn't work.
onNavigate:function(Products){
this.Loader();
var emptyData = [];
this.view.SegmentProducts.setData(emptyData);
Hi,
I'm curious how you are calling your function to remove the segment data? I have a simple function like this:
clearMessages:function() { this.view.segMessages.removeAll(); },
I call this function in my in my preshow event. It almost seems like this is a timing issue where you are calling your function at point where the segment isn't available yet.
Can you button a test button on your form that calls your removeAll() function and see if that works? That will tell you if the code works and then you can figure out when to call it.
Regards,
Hi,
So i tried what you suggested, on clicking the button the segment is getting empty, but when i go back and select some other category the segment is populated with previous data first and than the new data.
I think it is some kind of cache clear issue, is there a method to clear cache ?
The issue was that my array was not empty when i select a new category, so i removed elements from my array and it worked for me.
Thanks
Glad you figured out!