OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Don't hide dropdown list when clicked inside it

  • Thread starter Thread starter JDoeBloke
  • Start date Start date
J

JDoeBloke

Guest
I've made this dropdown menu using bootstrap. The problem is that it hides itself when I click inside it or check a checkbox inside it as well. How do I get it not to close unless clicked somewhere outside the dropdown. Thanks in advance!

Code:
<div class="ibox-tools">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true">
        <i class="fa fa-line-chart"></i>
    </a>

    <ul class="dropdown-menu dropdown-user" style="width:200px">
        @foreach(PKG_VLTROUTINE_GET_EXCHAGEINFO_Result cur in Model)
        {
            <li style="padding:5px">
                <strong>@cur.VLTNAME</strong>
                &nbsp;@cur.RATE
                <br />
                <small>@cur.VLTFULLNAME</small>
                <small>
                    (
                    @cur.RATEDIF
                    @if (cur.DIRECTION == 1)
                    {
                        <i style="color:#1ab394" class="fa fa-level-up text-navy"></i>
                    }
                    else
                    {
                        <i style="color:#ed5565" class="fa fa-level-down text-navy"></i>
                    }
                    )
                </small>
                <div class="MsSwitch MsSwitch-update">
                    <input data-evoldvall="-1" value="-1" type="checkbox" checked="" data-valtrue="-1" data-valfalse="" name="@cur.VLTNAME" class="evCheckBox">
                    <label for="@cur.VLTNAME"></label>
                </div>
                <li class="divider" style="margin:0px"></li>
            </li>
        }
    </ul>
<p>I've made this dropdown menu using bootstrap. The problem is that it hides itself when I click inside it or check a checkbox inside it as well. How do I get it not to close unless clicked somewhere outside the dropdown.
Thanks in advance!</p>

<pre><code><div class="ibox-tools">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true">
<i class="fa fa-line-chart"></i>
</a>

<ul class="dropdown-menu dropdown-user" style="width:200px">
@foreach(PKG_VLTROUTINE_GET_EXCHAGEINFO_Result cur in Model)
{
<li style="padding:5px">
<strong>@cur.VLTNAME</strong>
&nbsp;@cur.RATE
<br />
<small>@cur.VLTFULLNAME</small>
<small>
(
@cur.RATEDIF
@if (cur.DIRECTION == 1)
{
<i style="color:#1ab394" class="fa fa-level-up text-navy"></i>
}
else
{
<i style="color:#ed5565" class="fa fa-level-down text-navy"></i>
}
)
</small>
<div class="MsSwitch MsSwitch-update">
<input data-evoldvall="-1" value="-1" type="checkbox" checked="" data-valtrue="-1" data-valfalse="" name="@cur.VLTNAME" class="evCheckBox">
<label for="@cur.VLTNAME"></label>
</div>
<li class="divider" style="margin:0px"></li>
</li>
}
</ul>
</code></pre>
Continue reading...
 
Top