addPanel(): void {
let panel: PanelModel[] = [{
'sizeX': 1, 'sizeY': 1, 'row': 0, 'col': 0
}];
this.dashboard.addPanel(panel[0]); //this is used to add panel and in dashboard space.
let jsonInfo = JSON.Stringify(this.dashboard.serialize()) -- [{"id":"layout_0","row":0,"col":0,"sizeX":1,"sizeY":1}]
since in panel model i have not given any id so it is taking id as "layout_0", even I tried with providing custom id but it also not working for my issue
In jsonInfo, I am getting all the adding panels information which are present in dashboard space. Now in database I am accessing this panelJson and fetching id and its postion parameter and storing in table.
Above senerio works fine till remain on that page and keeps adding panel.
Now when again I refresh page, I call store procedure in which I fetch the panelid with position and it renders well on right positions.
getting data :
[{"id":"layout_1","row":0,"col":1,"sizeX":1,"sizeY":1}]
[{"id":"layout_0","row":0,"col":0,"sizeX":1,"sizeY":1}]
now when I add panel it is adding panel again with the defaultid as "layout_0" and now the panelJson is forming for all the panels in the following way which is wrong.
[{"id":"layout_0","row":0,"col":1,"sizeX":1,"sizeY":1,"minSizeX":1,"minSizeY":1,"maxSizeX":null,"maxSizeY":null},{"id":"layout_1","row":1,"col":0,"sizeX":1,"sizeY":1,"minSizeX":1,"minSizeY":1,"maxSizeX":null,"maxSizeY":null},{"id":"layout_2","row":0,"col":1,"sizeX":1,"sizeY":1,"minSizeX":1,"minSizeY":1,"maxSizeX":null,"maxSizeY":null},{"id":"layout_0","row":0,"col":0,"sizeX":1,"sizeY":1,"minSizeX":1,"minSizeY":1,"maxSizeX":null,"maxSizeY":null}]
please help me out, if possible please arrange a call if you are not getting my exact issue