Viewport renders in the wrong location

16 views
Skip to first unread message

auzroz

unread,
Nov 13, 2015, 6:33:53 PM11/13/15
to Netzke
Trying to determine if this is a bug, or if I am missing something.
I am trying to render a Viewport object in the middle of a rails page. i.e.
<html>
 
<head>
 
</head>
 
<body>
   
<div class="header">
   
</div>
   
<div class="content">
     
<%= netzke :customers_and_customer_inputs  %>
    </div>
 
</body>
</html>

But, when it renders, the viewport is actually being rendered at the top of the <body> section. And a simple <div> tag with the component is being displayed where the viewport should be.

Thoughts?

Max Gorin

unread,
Nov 13, 2015, 6:38:35 PM11/13/15
to net...@googlegroups.com
ExtJS's Viewport is designed to occupy the complete page - so, it'll always try to. Use a Panel to display it anywhere on the page.


Max Gorin
@mxgrn
author of @netzke
--
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netzke/48ff8edf-e6d7-4926-be4a-8603046b8757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

auzroz

unread,
Nov 13, 2015, 6:43:17 PM11/13/15
to Netzke
Thanks for the quick reply!
My current use case has a Grid on the left (Customers) and a Form of attributes on the right (Customer Inputs), one-to-one relationship. They are separate models in rails and when I click on a row in the grid, it opens up the associated inputs on the right. Is it possible to achieve the side-by-side in a panel?

Max Gorin

unread,
Nov 13, 2015, 6:53:38 PM11/13/15
to net...@googlegroups.com
Absolutely. Just inherit your composite component from Netzke::Base instead of Netzke::Basepack::Viewport. This also may help: https://www.airpair.com/javascript/posts/getting-started-with-netzke


Max Gorin
@mxgrn
author of @netzke

--

You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.

auzroz

unread,
Nov 13, 2015, 6:59:41 PM11/13/15
to Netzke
Haha, that was easy. Thanks! It works awesome now. I have been using the airpair site to get me started and it is really helpful.
Reply all
Reply to author
Forward
0 new messages