Alpha related T5

there is a page with two tables and iam conditionaly rendering that based on the url , so in first page in the table when i add something, it is updating in the array inside alpha.local. but in other page when i check the second table this same array is empty.both tables builded in one page but just rendering conditionally.why that is happening ? how can i update the local object in second page too?do i need to call case service or something for this?

@Sam @irfanali

2 Likes

Hi @NavneethCk,

If your datasource is inside local, you can use the snippet code below to refresh the datasource for both tables.

window.dispatchEvent( // The event name should be exactly this: "alpha_element:connected_callback" new CustomEvent('alpha_element:connected_callback', { detail: { element: ap.$(<id>), }, }) );

On the table id is expected as a string.

can i call this snippet inside custom code in alpha?
@Simphiwe

Yes after conditionally showing a table

i want to update the array inside alpha.local inside the second page after rendering .so which table id is needed to provide?the second one right?
@Simphiwe

The one that doesn’t get updated, so yes the second one.

After showing the second table can you confirm aswell on the console if alpha.local has your table datasource array.

hello @Simphiwe ,

it is not working.
window.dispatchEvent( ā€œalpha_element:connected_callbackā€ , new CustomEvent(ā€˜alpha_element:connected_callback’, { detail: { element: ap.$(ā€˜1490a7c5-fe78-42c6-b8fa-e8fc659417c7’), }, }) ); i provided this snippet and provided table id i got from page on the right side bar.how can i fix this?

After conditional displaying a second table can you confirm from alpha.local in the console if your table datasource has the values.

i tried that.the array inside local is empty in the second page @Simphiwe

@NavneethCk can you share your project link on the chat