1

I am facing an issue in particular case where reference of dragged widgets are overlapping.

I have an empty dashboard with button and user can add widgets by dragging this button. When user add new widget, previous widget params are also updated which should not.

Steps to reproduce:

  • Open https://jsfiddle.net/xs5r6mma/2/
  • Add widget by dragging “Drag Me” button
  • Enter some value in input field and update
  • Add another widget by dragging “Drag Me” button.

Now observer, this new widget title has the same name which u entered for 1st widget. Can you please confirm me if there is something I am doing wrong? My requirement is to add widgets by drag and drop on empty dashboard through some button.

myLayout.createDragSource($("#button"), {
  type: 'component',
  componentName: 'example',
  componentState: {
        text: 'Button'
      }
});
Mistalis
  • 17,793
  • 13
  • 73
  • 97
Shafaq Kazmi
  • 215
  • 1
  • 3
  • 12
  • what do you mean by 'previous widget params are also updated' ? , i can see that when you create a new widget, it takes the already existing title as the name, which you can change by entering a new name in the text box – gaurav5430 Dec 19 '16 at 13:47
  • Yes this is the problem. Apparently, it seems no issue but when u try to save the state, it returns the same params. When I get the params of state change, it will return same params for all widgets. https://jsfiddle.net/xs5r6mma/3/ ` myLayout.on( 'stateChanged', function(){ var state = myLayout.toConfig() ; console.log(state); });` – Shafaq Kazmi Dec 19 '16 at 14:02
  • Any help on this? – Shafaq Kazmi Dec 24 '16 at 15:29
  • see this : https://github.com/deepstreamIO/golden-layout/issues/131 – gaurav5430 Dec 26 '16 at 04:40
  • Thanks @gaurav5430 – Shafaq Kazmi Dec 27 '16 at 06:24

0 Answers0