template node scrolling

297 views
Skip to first unread message

Pierre de Giorgio

unread,
Feb 9, 2017, 8:35:46 PM2/9/17
to Node-RED
I've created a couple of template nodes with some html.  The problem i'm having is that it seems as though the template node "size" is bigger than the area in the group that it occupies (vertically).  So, it wants to scroll up and down a little as you scroll over the node in the group.  At first I was seeing scrollbars, but they are gone now.  I'm not sure how or why.

Has anyone experienced this and if so, is there something I can do in my html code to make it fit the size correctly?

Colin Law

unread,
Feb 10, 2017, 4:17:11 AM2/10/17
to node...@googlegroups.com
I *think* that if you put a div round it then you may get the scroll bar back.

Colin

On 10 February 2017 at 01:35, Pierre de Giorgio
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/fa6a32bd-3b6b-440b-a7fb-a63ade7fae3e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Pierre de Giorgio

unread,
Feb 10, 2017, 8:47:01 AM2/10/17
to Node-RED
Colin....I don't think I explained myself very well.  The scrollbars were an undesired effect.  I didn't want them to begin with.  The issue is that the window scrolls and I don't want it to at all.  I want the window to be fixed.  In other words I want the template html to fit in the autogenerated vertical space perfectly without the need to scroll at all.  What happens is that part of the graphics I have in the template node scroll a little up and down and it hides some of it.  Does that make sense?

Colin Law

unread,
Feb 10, 2017, 9:02:20 AM2/10/17
to node...@googlegroups.com
Sorry I should have said that was only able to address the second part
of your question (the scroll bars that mysteriously disappeared). I
don't know about the first part of the question.

Colin

On 10 February 2017 at 13:47, Pierre de Giorgio
> https://groups.google.com/d/msgid/node-red/652cfdf7-6b3d-42b4-bdea-9562501057ce%40googlegroups.com.

Pierre de Giorgio

unread,
Feb 10, 2017, 10:26:11 AM2/10/17
to Node-RED
Well I figured out at least one of the template nodes.  I was using a table to to layout everything.  I got rid of the table and tried using only "div" and "span" instead and it is working.  Now onto the next one (which isn't using tables).

Dave C-J

unread,
Feb 10, 2017, 11:23:10 AM2/10/17
to node...@googlegroups.com
If you want it to autofit... then the html needs to be renderable at time of first rendering as is tries to use that to calculate the height needed. If data is then injected and (for example adds a line) then the height would grow but the template won't resize unless you refresh the page. (I did try letting it resize - but that goes mad if you have something rapidly updating a template). So ideally the initial contents needs to be the max size you want it to be...

Also the algorithm to autofit may not be perfect so... happy to consider any bad examples to improve on.

Pierre de Giorgio

unread,
Feb 10, 2017, 11:39:01 AM2/10/17
to node...@googlegroups.com
Thanks for the response....that make sense now.

Removing the table/tr/td tags and going to div definitely fixed it.  In my case there was no dynamic data in it.  

Second template I have is using a dygraphs trend.  They heigh for that DOES dynamically scale.  So, i specified the height for the dygraph object and the scrolling effect went away.


Best Regards,

Pierre de Giorgio
BlueBay Automation
615-554-4924

On Fri, Feb 10, 2017 at 10:23 AM, Dave C-J <dce...@gmail.com> wrote:
If you want it to autofit... then the html needs to be renderable at time of first rendering as is tries to use that to calculate the height needed. If data is then injected and (for example adds a line) then the height would grow but the template won't resize unless you refresh the page. (I did try letting it resize - but that goes mad if you have something rapidly updating a template). So ideally the initial contents needs to be the max size you want it to be...

Also the algorithm to autofit may not be perfect so... happy to consider any bad examples to improve on.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/0i_mPF7W3lE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages