DropdownMenu getting re-initialize

Tags: #<Tag:0x00007f8b1e1e9140>

I have doubt i am loading data through function (say loadData function name) via ajax and then passing that data to hand on table this is working fine but whenever i am performing some operation such as move column,freeze column after successful completion of that operation i am again calling the loadData to get the updated data set but then dropdown menu is getting re initialized, so the item in menu getting display twice/thrice and so on.

I am sharing drive link of the above scenario you can have a look https://drive.google.com/file/d/1fjDBwTTscrS6otWhr4KzgMdc2KXcIAtO/view

How to overcome this issue ?

One More help i have added remove_col in dropdownMenu and it is showing also but as a disable option not able to understand how to enable it. I have enable allowRemoveColumn to true.

Thanks in advance.

Hi @vineeth

in what moment to use the loadData method? Do you change anything in the settings while calling it? It would be easier to track down the issue with a demo.

Hi @aleksandra_budnik thanks for reply

I am sharing some piece of code, so that you get what i trying to do if any mistake i does then correct me


In the above image i just initializing the data to hand on table through ajax as i already said above.

Below code is the dropdownMenu item

Below is the custom function toLowerCase which basically transform the column value to lower case and after successful response i am recalling the loadData function to update the data set (rows & columns)

Even i have tried with method updateSettings by using this method dropdown is not getting re initialized as i am just updating the row & column in updateSettings but suppose i am doing operation such as removing a column, moving a column then the row data is getting updated but column header is not getting updated because of this data mismatch is happening.

I am sharing the video where basically i am trying to transform the column data to uppercase then after successfully transformation checking the drop down menu whether the item has been re initialized or not but it was fine as i used in this case hand on table updateSettings method to update only data and colHeaders. After that i tried to move the column as you can see name column item is empty and sponsor item has value after moving the column as row data got updated but column header is not updated and the result of that is name column has sponsor data and sponsor column has name column data. You can have a look for better understanding what i am trying to say

Help me out on the above scenario

Thank you for sharing, I will test it and share my thoughts.

Can you share a demo where I will be able to replicate it? It is hard to check some solutions without an opportunity to debug it.

Thanks for reply
Write now the code which i share above is in my personal machine but before friday i will deploy my code to development server then i can share a link with you or i can share my screen/code through team viewer.

OK. I keep my fingers crossed for tests.