link959 link960 link961 link962 link963 link964 link965 link966 link967 link968 link969 link970 link971 link972 link973 link974 link975 link976 link977 link978 link979 link980 link981 link982 link983 link984 link985 link986 link987 link988 link989 link990 link991 link992 link993 link994 link995 link996 link997 link998 link999 link1000 link1001 link1002 link1003 link1004 link1005 link1006 link1007 link1008 link1009 link1010 link1011 link1012 link1013 link1014 link1015 link1016 link1017 link1018 link1019 link1020 link1021 link1022 link1023 link1024 link1025 link1026 link1027 link1028 link1029 link1030 link1031 link1032 link1033 link1034 link1035 link1036 link1037 link1038 link1039 link1040 link1041 link1042 link1043 link1044 link1045 link1046 link1047 link1048 link1049 link1050 link1051 link1052 link1053 link1054 link1055 link1056 link1057 link1058 link1059 link1060 link1061 link1062 link1063 link1064 link1065 link1066 link1067 link1068 link1069 link1070 link1071 link1072 link1073 link1074 link1075 link1076 link1077 link1078 link1079 link1080 link1081 link1082 link1083 link1084 link1085 link1086 link1087 link1088 link1089 link1090 link1091 link1092 link1093 link1094 link1095

[Vue.js] Bootstrap-vue table _showdetails closes when data is updated Subscribe to RSS

there is a bootstrap-vue.js table, which is bound to a computed property that fetches some data from my vuex store.

Each row has a show_details button, which opens a second row as per this link:

However when the data changes in my vuex store, the table re-renders and looses its state (all of the opened ‘show_details’ rows go back to closed).

Is there any way to update the table data in the store and the table, without loosing the table’s current state?

Solution :

Once receiving the new data from the back-end, before updating the store, you could loop through the old table items array looking for the _showDetails property, and then update the new data array setting _showDetails if the rows are the same (say by using a primary key or other unique row identifier to correlate the rows). Then update the store items array with the new data.