引导折叠内容在点击时不会扩展

时间:2019-12-18 08:52:10

标签: html asp.net-mvc bootstrap-4

我有一个动态的导航窗格。我想使用Bootstrap使其可折叠。在某种程度上,我能够做到这一点。最后两个节点失败。我已据我所知适当地提供了折叠的ID和类,但是以某种方式,我无法实现折叠并向下滑动以突出显示下面的代码。请帮助我指出正确的方向:

<div id="DocumentResults" class="col-md-12 collapse" data-parent="#AccordionParent">
    <div class="col-md-12">
        @{
        var GenericDocumentCount = 0;
        var GenericDocumentOptionCount = 1;
        foreach (var document in Model.RegisteredDocs)
        {

        var idFordocument = @document.Symbol + @GenericDocumentCount;
        var idForDocumentOption = @document.Symbol + @GenericDocumentOptionCount;
        var idfordocsmain = idForDocumentOption + @count;

        <div id="ShowDocuments">
            <div class="parent-Cards">
                <div class="parent-Card" id="@document.GuID">
                    <a class="LinkedObjects collapsed" asp-controller="RegisteredCarriersAndDocuments" asp-action="GetDocument" asp-route-GUID="@document.GuID" data-target="#@idFordocument" data-toggle="collapse" aria-expanded="false" aria-controls="">
                        @document.DisplayName
                    </a>
                </div>
            </div>
        </div>

        <div id="@idFordocument" data-parent="#DocumentResults" class="collapse">
            <div class="">
                <div class="mb-0" id="@idfordocsmain">
                    <div class="col-md-1"></div>
                    <div class="col-md-11">
                        <a class="LinkedObjects" id='GenericOutputOptions' data-toggle="collapse" data-target="#@idForDocumentOption" aria-expanded="false" aria-controls="collapseOne">
                            Output Options
                        </a>
                    </div>
                    <div class="col-md-12 collapse" id="@idForDocumentOption" data-parent="#@idfordocsmain">
                        <div class="col-md-4"></div>
                        <div class="col-md-8">
                            @{ foreach (var option in document.Options)
                            {
                            <div class="sidebar-item" data-parent="#@idFordocument">
                                <a class="LinkedObjects" asp-controller="RegisteredCarriersAndDocuments" asp-action="GetCarrierDocumentOption" asp-route-option="@JsonConvert.SerializeObject(@option)">
                                    @option.Stock.ToString() , @option.Output.ToString()
                                </a>
                            </div>
                            }
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
        }
        }
    </div>
</div>

0 个答案:

没有答案