forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Collection removeData
maxkfranz edited this page Mar 8, 2012
·
4 revisions
Deletes specified client-defined data associated with the elements.
Deletes all data for all elements in the collection
Deletes data for the specified key for all elements in the collection
key : The name of the data field to remove for the elements
Deletes data for all specified keys in the list for all elements in the collection
list : A string of space-separated data field names to remove, or an array of data field names to remove for the elements
If eles.removeData() is called without arguments, it will remove all data for the element or collection.
var n1 = cy.nodes("#n1");
n1.data("weight", 56);
console.log( n1.data("weight") ); // 56
n1.removeData("weight");
console.log( n1.data("weight") ); // undefined