PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, June 27, 2022

[FIXED] How to use the :not selector in Cytoscape.js? (To select nodes that don't have an attribute)

 June 27, 2022     css-selectors, cytoscape.js, graph, javascript     No comments   

Issue

I'm trying to use the :not selector in cytoscape.js. I want to select all nodes that don't have a specific attribute to open an context menu. E.g.:

cy.cxtmenu({
    selector: not('node.selection'),
    commands: [ .... ]
});

But I'm not sure how I can do this in cytoscape.js. Any help will be welcome.


Solution

[^name] Matches elements if the specified data attribute is not defined, i.e. undefined (e.g [^foo]). Here, null is considered a defined value.

http://js.cytoscape.org/#selectors/data



Answered By - maxkfranz
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing