Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Changing group dynamically doesn't redraw the object #1677

Closed
falbuisech opened this issue Feb 19, 2016 · 3 comments
Closed

Changing group dynamically doesn't redraw the object #1677

falbuisech opened this issue Feb 19, 2016 · 3 comments

Comments

@falbuisech
Copy link

Hi, my problem is when creating dynamically networks. If I add nodes I can perfectly select a group for it to be represented (p.e.g. a router icon). It is saved in locale without problem, but when I change the node's group via editNode, it changes in locale but no in the interface, whereas the label or ID changes in both.
I think it's a problem with some redraw.

      addNode: function (data, callback) {
        // filling in the popup DOM elements
        document.getElementById('operation').innerHTML = "Add Node";
        document.getElementById('node-id').value = data.id;
        document.getElementById('node-label').value = data.label;
        document.getElementById('node-group').value = data.group;
        document.getElementById('saveButton').onclick = saveData.bind(this, data, callback);
        document.getElementById('cancelButton').onclick = clearPopUp.bind();
        document.getElementById('network-popUp').style.display = 'block';
      },
      editNode: function (data, callback) {
        // filling in the popup DOM elements
        document.getElementById('operation').innerHTML = "Edit Node";
        document.getElementById('node-id').value = data.id;
        document.getElementById('node-label').value = data.label;
        document.getElementById('node-group').value = data.group;
        document.getElementById('saveButton').onclick = saveData.bind(this, data, callback);
        document.getElementById('cancelButton').onclick = cancelEdit.bind(this,callback);
        document.getElementById('network-popUp').style.display = 'block';
      },
@AlexDM0
Copy link
Contributor

AlexDM0 commented Feb 20, 2016

Hi,

It would be great if you can show this is a jsbin so we can easily reproduce this.

Regards

On 19 Feb 2016, at 19:52, falbuisech [email protected] wrote:

Hi, my problem is when creating dynamically networks. If I add nodes I can perfectly select a group for it to be represented (p.e.g. a router icon). It is saved in locale without problem, but when I change the node's group via editNode, it changes in locale but no in the interface, whereas the label or ID changes in both.
I think it's a problem with some redraw.

  addNode: function (data, callback) {
    // filling in the popup DOM elements
    document.getElementById('operation').innerHTML = "Add Node";
    document.getElementById('node-id').value = data.id;
    document.getElementById('node-label').value = data.label;
    document.getElementById('node-group').value = data.group;
    document.getElementById('saveButton').onclick = saveData.bind(this, data, callback);
    document.getElementById('cancelButton').onclick = clearPopUp.bind();
    document.getElementById('network-popUp').style.display = 'block';
  },
  editNode: function (data, callback) {
    // filling in the popup DOM elements
    document.getElementById('operation').innerHTML = "Edit Node";
    document.getElementById('node-id').value = data.id;
    document.getElementById('node-label').value = data.label;
    document.getElementById('node-group').value = data.group;
    document.getElementById('saveButton').onclick = saveData.bind(this, data, callback);
    document.getElementById('cancelButton').onclick = cancelEdit.bind(this,callback);
    document.getElementById('network-popUp').style.display = 'block';
  },


Reply to this email directly or view it on GitHub.

@falbuisech
Copy link
Author

I simply modified the example \node_modules\vis\examples\network\other\manipulation.html adding some groups and the option to change them. I attach the file as a .txt
manipulation - copy.txt

I'm sorry but I'm pretty new in this so I don't know how to use properly Jsbin

@AlexDM0
Copy link
Contributor

AlexDM0 commented Feb 21, 2016

I see what you mean now. I've pushed a fix to develop, it should be added in the next release.

Regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants