cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
693
Views
0
Helpful
4
Replies

Changing view when event occurs

viihallja
Level 1
Level 1

Hi,

What is the best way to change view when event occurs? I want to display different view when node is clicked.

Thanks.

4 Replies 4

alzverev
Cisco Employee
Cisco Employee

Hi -

what did you mean by 'view'? Give me more details please

- Alex

I was trying to create view that would display something like "Click node to show info" and when node is clicked it would show node info, like id and name.

Basically something like this:

view: {

     content: {

          tag: 'h1',

          content: 'Click node to show info'

     }

}

would be replaced with:

view: {

    content: [

        {

            tag: 'ul',

            props: {

                template: {

                    tag: 'li',

                    content: [

                        {

                            tag: 'p',

                            content: '{id}'

                        },

                        {

                            tag: 'p',

                            content: '{name}'

                        }

                    ]

                },

                items: '{node}'

            }

        }

    ]

}

I'm not sure if I should create two separate views and somehow change between them when the click-event occurs or just replace the content.

I hope this clarifies.

Let me describe it just as I understand:

You have a topology; when you click on a node, a pop-up appears, which says 'Click on a node/something to display information'. And when you click it, the information reveals inside the pop-up.

Is that correct?

Alex

I have a topology and sidebar. Sidebar should say "Click node to display information" when page is loaded and change to node info when node is clicked.