When I click on refresh it becomes half visible - html

I have on my page a grid where I show log history and a refresh button ( onclick I refresh the grid with new data ).
<div dojoType="dijit.layout.ContentPane" title="Log history">
<button dojoType="dijit.form.Button" id="btn_refresh" onclick="load_logs" style="float:right; border:1px solid black;">Refresh</button>
<div dojoType="dojo.data.ItemFileReadStore" jsId="log" data="window.store_data_log"> </div>
<div id="grid_log" dojoType="dojox.grid.DataGrid" store="log" structure="window.layout_log" queryOptions="{deep:true}" query="{}" clientSort="true" rowsPerPage="5"> </div>
</div>
Before
After
Problem is that when I click, in Chrome, my refresh button moves up and become half visible. I tried to put <BR/> after the button but then grid is then not visible at all. I tried to put the button in a new but also then grid is not visible at all. What to do ?

I had a similar issue and decided to use dijit.layout.LayoutContainer and dijit.layout.ContentPane which has worked great. On the main content pane just set layoutAlign="client" and it will take up the remaining layout space.
<div dojoType="dijit.layout.ContentPane"
title="Log history">
<div dojoType="dijit.layout.LayoutContainer"
style="width: 100%; height: 100%;">
<div dojoType="dijit.layout.ContentPane"
layoutAlign="top"
style="height:28px;padding:2px;">
<button dojoType="dijit.form.Button"
id="btn_refresh"
onclick="load_logs"
style="float:right; border:1px solid black;">
Refresh</button>
</div>
<div dojoType="dijit.layout.ContentPane"
layoutAlign="client"
style="padding:0px 2px;">
<div dojoType="dojo.data.ItemFileReadStore"
jsId="log"
data="window.store_data_log"> </div>
<div id="grid_log"
dojoType="dojox.grid.DataGrid"
store="log"
structure="window.layout_log"
queryOptions="{deep:true}"
query="{}"
clientSort="true"
rowsPerPage="5"> </div>
</div>
</div>
</div>

Related

how can I align a button with text area?

I want to align my button horizontally with text area,like this image
Currrent code:
<div class="container">
<div class='row'>
<div class="col-sm-1">
<img style="border-radius:50%;width:70px;height:70px;" src="https://images.discordapp.net/avatars/<%=user.id%>/<%=user.avatar%>.png?size=512">
</div>
<div class="col-sm-11">
<textarea style='width:70%;height:100%' placeholder='Leave a review for this shop'></textarea>
</div>
<div style="margin-top:5px;margin-bottom:5px;width:70%;display: flex;justify-content: space-between">
<div>
<span class="review" data-rating="0"></span>
<br>
Please make sure to check our review guidelines before posting.
</div>
<button class="button_div" style="width:auto;display:block;margin-left: auto;margin-right: 0;" >Post Review</button>
</div>
</div>
</div>
The total screen size is 12. you gave the image col-sm-1, and you gave the textfield col-sm-11 that takes up the entire column, you have to reduce col-sm-11 for the textfield to something else so that the preview bottom can fit.
Or
You can add the preview button into the same div as the textfield.

how to set position of the floating pane in dojo?

I created a simple floating pane declaratively(the below code) . everything is good. I have a button that click on it and the floating pane will open. the problem is that if i again click the button, the floating pane position is change from the previous position . How can i set position of the floating pane. another problem is the top,left and position:absolute is not working for my floating pane .
<body class="claro" role="main">
<div id="bc" style="width:100%; height:100%; padding: 5px;" dojoType="dijit.layout.BorderContainer">
<div id="header" dojoType="dijit.layout.ContentPane" region="top" splitter="true">
</div>
<div dojoType="dojox.layout.ExpandoPane"
splitter="true"
duration="125"
region="left"
previewOnDblClick="true"
id="leftPane"
maxWidth="275"
style="width: 275px;">
<div dojoType="dijit.layout.TabContainer" attachParent="true" tabPosition="bottom" tabStrip="true">
<div dojoType="dijit.layout.ContentPane" title="Legend">
<div id="legendDiv"></div>
</div>
<div dojoType="dijit.layout.AccordionContainer" title="Search" style="width:275px;" attachParent="true">
<div dojoType="dijit.layout.ContentPane" title="Attribute search">
<div class="searchBar">
<p>
<label for="searchBox" style="float: left;">Search:</label>
<input id="searchBox" name="searchBox" style="float: left;">
<span id="runSearchIcon" style="border: none; floast: left; padding: 3px;">
</span>
</p>
</div>
<ul id="dojoList"></ul>
</div>
<div dojoType="dijit.layout.ContentPane" title="spatial search">
<ul id="dijitList"></ul>
</div>
</div>
</div>
</div>
<div dojoType="dijit.layout.ContentPane" region="center" id="centerPane" tabStrip="true">
<div id="mymap" style="width:100%;height:100%"> </div>
<div data-dojo-type="dojox.layout.FloatingPane" id="dFloatingPane"
title="A floating pane" data-dojo-props="resizable:false, dockable:true,closable:false, title:'Tools'"
style="position:absolute;top: 100px;;left:0;width:70px;height:150px;visibility:hidden;">
This is the content of the pane!
</div>
<div data-dojo-type="dijit.form.Button" data-dojo-props="label:'Show me', onClick:function(){dijit.byId('dFloatingPane').show();}" style="position:absolute;top: 150px;left: 20px;"></div>
</div>
</div>
</div>
</body>
Easiest way would be to set the position:absolut with every click on the Button to the first position by using domStyle.
domStyle.set("dFloatingPane",{
position:"absolute",
top:"100px",
left:"0px"
});
Simple solution just create a div and set position relative , position relative control absolute, here is the sample code eg. check and understand
<div style="position:relative">
<div data-dojo-type="dojox.layout.FloatingPane" id="dFloatingPane"
title="A floating pane" data-dojo-props="resizable:false, dockable:true,closable:false, title:'Tools'"
style="position:absolute; top: 100px; left:0; width:70px;height:150px; visibility:hidden;">
This is the content of the pane!
</div>
<div data-dojo-type="dijit.form.Button" data-dojo-props="label:'Show me', onClick:function(){dijit.byId('dFloatingPane').show();}" style="position:absolute;top: 150px;left: 20px;"></div>
</div>
Position:relative Control position:absolute , so you can set your top or bottom position accordign to your dessign thanku, hope you understand my point.

Bootstrap textarea width not resizing

I have the following page and I want the textarea width to take up the rest of the width of the page but the width style isn't changing the size at all and I'm not sure why. If I change the txtChatMsg textarea width style to anything nothing changes visually.
<div class="container-fluid">
<div class="row" style="margin-top: 10px; background-color: aqua;">
<div id="divPortrait" class="col-md-3 text-center">
<img src="~/Content/good_guy.png" />
</div>
<div id="divChat" class="col-md-9" style="background-color: gray;">
<div class="row">
<div id="divMessages">
<!--DYNAMICALLY ADD DIVS FOR EACH CHAT MSG INSIDE HERE-->
<div>
Test Message here
</div>
</div>
</div>
<div class="row" style="background-color: red;">
<textarea id="txtChatMsg" class="form-control" style="width: 100%;" rows="2" placeholder="Write a reply..."></textarea>
</div>
<div class="row text-right" style="margin-top: 5px;">
<button type="button" class="btn btn-default">Send</button>
</div>
</div>
</div>
As dm4web stated, there's something external to the code that you you posted that is causing this behavior. To prove it, here's a JSFiddle where the style on the txtChatMsg element has been changed to width: 50%.
You could try inspecting the txtChatMsg element in your browser to see if there's any styles overriding the CSS width rule. I'd also check to see if there's any Javascript that is potentially targeting this div and overriding the width.

UIKIT Grid columns not staying adjacent to each other

I am using uikit 2.8.0. I am trying to create a two column grid structure. But the two columns don't appear adjacent to each other. The second column slides down the first one.
<body>
<div class="uk-container uk-container-center uk-margin-large-bottom">
<nav var code.......>
<div class="uk-grid" data-uk-grid-margin>
<div class="uk-width-medium-1-1 uk-text-center">
<h1>Tell us more about yourself</h1>
</div>
</div>
<div class="uk-grid" data-uk-grid-match="{target:'.equal-height'}">
<div class="uk-width-large-6-10" style="margin: 0 20% 0 20%;">
<div class="uk-width-7-10 uk-width-small-1-1 uk-width-medium-7-10 uk-width-large-7-10" style="border: 1px solid #B4B3B3;height:100px;">
</div>
<div class="uk-width-3-10 uk-width-small-1-1 uk-width-medium-3-10 uk-width-large-3-10" style="border: 1px solid #B4B3B3;height:100px;">
</div>
</div>
</div>
</div>
I tried many options. But come what may, the second grid would not stay side by side to the first one.
How can I fix this? Any tool that I can use to debug the layout? I am using chrome developer tools without any success.
You needed to add class ".uk-grid" to the div with styled margin (uk-width-large-6-10), as you want to make a grid inside that element.
Plus this, the "Target" element should target to something existing, best to "uk-panel" placed inside the element with "uk-width".
<div class="uk-container uk-container-center uk-margin-large-bottom">
<nav var code.......>
<div class="uk-grid" data-uk-grid-margin>
<div class="uk-width-medium-1-1 uk-text-center">
<h1>Tell us more about yourself</h1>
</div>
</div>
<div class="uk-grid">
<div class="uk-width-large-6-10 uk-grid" style="margin: 0 20% 0 20%;" data-uk-grid-match="{target:'.uk-panel'}">
<div class="uk-width-7-10 uk-width-small-1-1 uk-width-medium-7-10 uk-width-large-7-10" style="background-color:green; height:100px;">
<div class="uk-panel"> </div>
</div>
<div class="uk-width-3-10 uk-width-small-1-1 uk-width-medium-3-10 uk-width-large-3-10" style="background-color:red; height:100px;">
<div class="uk-panel"> </div>
</div>
</div>
</div>

Form messing up layout of webpage

I am beginning a webpage, but I'm having a problem. I added a form with some information to start a login form. I tried adding a margin and padding to the form, but it is still completely messed up. Here is the code for the area that gets messed up, and the form.
<div id="body" style="width:100%;height:1000px;margin-left:5%;margin-right:5%;margin-top: 5px;">
<div style="width:20%;display:inline-block;text-align:left;border: 2px green solid;"></div>
<div id="paddingLeft" style="width:4%;display:inline-block"></div>
<div style="display:inline-block; width: 50%;"></div>
<div id="paddingRight" style="width:4%;display:inline-block"></div>
<div id="loginTitle" style="display:inline-block; width: 20%;border:2px green solid;text-align:center;" class="style1">Login</div>
<div style="width:20%;display:inline-block;text-align:left;height:100px;border: 2px green solid;"></div>
<div id="paddingLeft2" style="width:4%;display:inline-block;height:100px;"></div>
<div style="display:inline-block; width: 50%;height:100px;"></div>
<div id="paddingRight2" style="width:4%;display:inline-block;height:100px;"></div>
<div id="loginFormArea" style="display:inline-block; width: 20%;height:100px;border:2px green solid;text-align:center;">
<form method="get" id="loginForm" style="height: 100%;padding:2px">
<span class="style1" id="Username" style="display:inline-block; width:40%;">Username:</span>
<input id="usernameInput" name="Text1" type="text" style="width:40%;display:inline-block;margin-top: 5px;height:15px" />
</form>
</div>
</div>
Try this:
<div id="bodywrapper" style="width:100%;height:1000px;margin-top: 5px;">
instead of:
<div id="body" style="width:100%;height:1000px;margin-left:5%;margin-right:5%;margin-top: 5px;">
My suggestion is:
don't call the id of the div "body". body is a structural element in html.
remove margin left and right. You already say it should be width:100%, so it's unpredictable to add margin on that. You can add padding instead, if you want. That might have the effect you are looking for.