Has anyone figured out how to drag rows around in a perspective table? Need user to be able to change the sort order of rows that will then be saved in the database.
I don't think this is possible, but I'd love to know. I have a perfect application for it
Have once applied this functionality by adding a view to each row of the table that included and icon of an up and down arrow. Clicking an arrow would send a perspective message to the table that would change the order of its data by indexing the row up or down 1.
I did the same, but implemented with a flex repeater. I really would like a draggable list, just like a playlist on modern music services
Maybe @victordcq knows if possible with magic hacks?
heh would require some tinkering, but ive done a drag and drop before
You could make a view for the first column but isntead with the arrow use something like this...
i can play around with this a bit more tmw Might be possible to not require a view/column and just make the whole row draggable but ill have to take a deeper look
Seems to me like it would be easier with a flex repeater...
ah it was easy, ignition puts its row id in a data atrribute so it was easy to read.
Turn of virtualized on your table.
copy the markdown
and add in a custom property on the view
you probably will have to adapt the onchange script in the view.custom element to your needs.
sometimes the columns seem to move around too when you drag a row... not sure why or how to prevent that... probably clashing with the other drag events on the table xd
ahah, turn this off too, well unless you dont mind
(also just gona link this to my other jsinjects post