q-table selection not working with [row-key="--index"] after quasar upgrade
-
I don’t have unique key in my data set, so i used --index property for row-key and i was able to select single/multiple. But after upgrading to v1.4.5 its not working. I want to know that how to select single/multiple records when data rows don’t have unique key.
-
@jitendra16 https://forum.quasar-framework.org/topic/4723/quasar-v1-4-4-released __index was private and has been removed for performance reasons, what you could do is assign a key prop on your data array.
Ie.
//script const dataWithIdx = origData.map((val,idx) => ({...val, index: idx})) ... data: dataWithIdx, ... <template> ... <q-table ... row-key="index" ... ...
-
@metalsadman i also did this work around and it worked perfectly. I wanted to know that, is there any quasar way to do it?
-
@jitendra16 this is one of the ways to do it, see the link and my explanation.