[英]extjs grid hide and show changes width
I have a extjs grid simple stuff within a div. 我在div中有一个extjs网格简单的东西。 I hide and show that container by clicking a button. 我通过单击按钮隐藏并显示该容器。 after hiding the container, if I resize the window, and then again show the container, the grid gets a width of 100px. 隐藏容器后,如果我调整窗口大小,然后再次显示容器,则网格的宽度为100px。 I would expect it to make use of width:100% 我希望它能利用宽度:100%
.container{
border:1px solid gold;
}
.row{
padding:20px;
}
.col4{
width:30%;
float:left;
padding:20px;
font-size:20px;
background-color:red;
color:#fff;
}
</style>
<script>
$(document).ready(function(){
$(".btn").click(function(){
$(".container .thrd-row").css("display","none");
});
$(window).resize(function(){
$(".container .thrd-row").removeAttr("style");
});
});
</script>
//use html
<div class="container">
<div class="row firs-row">
<div class="col4">1</div>
<div class="col4">1</div>
<div class="col4">1</div>
</div>
<div class="row second-row">
<div class="col4">1</div>
<div class="col4">1</div>
<div class="col4">1</div>
</div>
<div class="row thrd-row">
<div class="col4">1</div>
<div class="col4">1</div>
<div class="col4">1</div>
</div>
<button class="btn">click hide</button>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.