How can I use a list to change the layout of the graph? Here is my codes, what's with it?

14 views
Skip to first unread message

沈小龙

unread,
Oct 21, 2013, 11:10:16 PM10/21/13
to cytos...@googlegroups.com

I want to click the 'Breadthfirst' to change the layout of the graph, but many times I tried have failed. 
What's wrong with me and how I to solve this?
 
//Here is a list of mine. I want to use 'click' to change the layout of the graph.
<li><a href="" onclick="" id='breathfirst'>Breadthfirst</a></li>
//It's onclick function
<script for='breathfirst' event='onclick' type='text/javascript'>
    update('breathfirst');
    return false;
</script>
//The main codes to initialize. The default layout is circle.
<script type="text/javascript">
  var value='circle';
  update(value);
  function update(value){
    $("#cy").cytoscape({
      layout: {
        name: value,
        fit:true
      },
....
}</script>

Thank you!

Max

unread,
Oct 28, 2013, 3:51:08 PM10/28/13
to cytos...@googlegroups.com
Have you tried using JS to bind to events? -M
--
You received this message because you are subscribed to the Google Groups "cytoscape.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscapejs...@googlegroups.com.
To post to this group, send email to cytos...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscapejs/363cb6ae-eafa-45ae-bda2-780f6022bba0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages