How to add a data to the first row(index 0) when new array added item added?

Tags: #<Tag:0x00007fa9898449e8>

Hello!
I’m using Vuejs and trying to add a new data to the first row every time when a new array added.

I’m making a small interface to manage the map related data(like node, link, vertax). When I add a new item(like nodes)with that interface(created with leaflet.draw.js) button, Handsontable also will get updated data. But the thing is that even I did columnSorting ‘desc’, whenever I add a new item, columnSorting changes to ‘asc’ automatically and all the new data is adding to the next row(currentIndex +1) But I need to add them to row at index 0 everytime…

I’ve added a png file. Hope it’s understandable! Please advise me if anyone knows how to do it!

Hi @r.chaehwa

Can you prepare a demo that we’ll be able to discuss and rebuild? I can see that you have two tables so I’d need to know what are the exact steps on each of the arrays. When you sort and when you add the data.

@aleksandra_budnik
Hello! I’ve sent you a support email. I have 3 tables:

  1. node
    2: link
    3: tracer(short in tfdt)

in our production, we made 3 components.

  1. grand-parent: map container, where handsontables are, import Map, HotTable
  2. parent: map component, import GrandChildComponent
  3. grand-child: leaflet-draw-wrapper container where adding a new component event occures.

When I add a new data by using left-side buttons(top 3 buttons for adding a new/ below’s are for the additional functions like move, copy, and so on), it send a new data to vuex and handsontable will get that new data, and then display it desc. but now, it’s being displayed as asc not desc. but default sorting is desc as I’ve setup.

Default is desc by Id(column 0), and same for when adding a new data. new data will get maxId +1 and has to be sorted desc.

Let me know if you need more info.

Regards,

Great, thank you. I’ll reply later today.