面板固定内容滚动
我正在尝试用 jQuery 和 ajax 做动态面板。
我的想法是,当我选择一个复选框时,执行我的 ajax 并返回带有此复选框的 category_id
的所有项目。我的所有过程都很好,但我的问题是我希望我的面板标题固定在我的模式中,并满足滚动-y 但我不能这样做。
这是我的代码:
// SET CATEGORY PRODUCT
$(".div-bag").append(`
<div class="container-offer-c" style="overflow-y: scroll; overflow-x: hidden; height: 150px; margin-bottom: 20px;">
<div class="panel-heading-offer bg-secondary"><span class="ml-3"> ARTICULOS C </span></div>
</div>
`);
// LOOP TO GET ITEMS C
$.each(response[0], function(index, value) {
$(".container-offer-c").append(`
<div class="container-offer-items" >
<div class="panel-heading-offer-items row align-items-center mt-2">
<div class="col-md-1 ml-2">
<input type="checkbox" class="${ value.id } selectItem" value="${ value.id }">
</div>
<div class="col-md-2 ml-2">
<span>${ value.codigo }</span>
</div>
<div class="col-md-4">
<span class="size-font">${ value.nombre }</span>
</div>
<div class="col-md-2">
</div>
<div class="col-md-2">
<input type="number" class="form-control" value="1" style="width: 100%; text-align:center">
</div>
</div>
</div>
`)
此代码导致:
但我需要修复我的面板,修复“ARTICULOS C”并使用滚动-y 修复他的内容
感谢您阅读我的内容,并对我的英语不好表示歉意
I'm trying to do dynamic panel in jQuery and ajax.
My idea is that when I select a checkbox execute my ajax and return all my items with category_id
that have this checkbox. All my process is ok, but my problem is that I want my panel heading to be fixed in my modal, and content with scroll-y but I can't to do this.
This is my code:
// SET CATEGORY PRODUCT
$(".div-bag").append(`
<div class="container-offer-c" style="overflow-y: scroll; overflow-x: hidden; height: 150px; margin-bottom: 20px;">
<div class="panel-heading-offer bg-secondary"><span class="ml-3"> ARTICULOS C </span></div>
</div>
`);
// LOOP TO GET ITEMS C
$.each(response[0], function(index, value) {
$(".container-offer-c").append(`
<div class="container-offer-items" >
<div class="panel-heading-offer-items row align-items-center mt-2">
<div class="col-md-1 ml-2">
<input type="checkbox" class="${ value.id } selectItem" value="${ value.id }">
</div>
<div class="col-md-2 ml-2">
<span>${ value.codigo }</span>
</div>
<div class="col-md-4">
<span class="size-font">${ value.nombre }</span>
</div>
<div class="col-md-2">
</div>
<div class="col-md-2">
<input type="number" class="form-control" value="1" style="width: 100%; text-align:center">
</div>
</div>
</div>
`)
This code results in:
but I need that my panel fixed, "ARTICULOS C" fixed and his content with scroll-y
Thanks for read me and sorry for my bad English
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了添加新 div 的问题:
I solved my problem adding a new div: