Panels are adding one over the other

Hi,
I want to share a scenerio,
I have added a panel through the ADD PANEL button. And this panel is saving in database  by clicking on the save button inside the panel. When this gets added to the db, sizex,sizey,col,row value added with it. Now when  I am adding another panel it is adding behind of the first panel. I want to add next to the first panel or down of the first panel.

I hope you understand the scenerio. Please help to achieve this.

1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team March 4, 2021 11:51 AM UTC

Hi RakhiS,  
 
Greetings from Syncfusion support. 
 
We have checked your query with DashboardLayout component. Panels are added to the DashboardLayout based on the provided panel settings (SizeX, SizeY, Row, Column).  
 
If you want to add the panel below another panel, you need to change the panel settings of adding panel. 
 
Please, refer the below code snippet. 
 
 public panel_json = [ 
    { 
      sizeX: 1, 
      sizeY: 1, 
      row: 0, 
      col: 0, 
      header: "<div>Panel 1</div>" 
    }, 
    { 
      sizeX: 1, 
      sizeY: 1, 
      row: 1, 
      col: 0, 
      header: "<div>Panel 2</div>" 
    }, 
    { 
      sizeX: 1, 
      sizeY: 1, 
      row: 2, 
      col: 0, 
      header: "<div>Panel 3</div>" 
    } 
  ]; 
  
onAdd(): void { 
    let panel: PanelModel[] = [ 
      { 
        id: this.count.toString() + "_layout", 
        sizeX: this.panel_json[this.count].sizeX, 
        sizeY: this.panel_json[this.count].sizeY, 
        row: this.panel_json[this.count].row, 
        col: this.panel_json[this.count].col, 
        content: "<div></div>", 
        header: "<div>Panel " + this.count.toString() + "</div>" 
      } 
    ]; 
    this.dashboardObject.addPanel(panel[0]); 
    this.count = this.count + 1; 
  } 
 
Please, refer the sample link below. 
 
 
Please, refer to the below links for DashboardLayout component. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon