Note that there are some explanatory texts on larger screens.

plurals
  1. POMis-alignment of asp:BulletedList <ul> when emptied
    primarykey
    data
    text
    <p>I have two asp:BulletedList's in a div "style=display:table". The idea is that one will contain asp:ListItems that the user can drag and drop between them to create another list of selected items.</p> <p>This is the code</p> <pre><code>&lt;div style="width:90%; display:table; border:1px solid green"&gt; &lt;div style="width:100%; display:table-row"&gt; &lt;div style="width:35%; display:table-cell; border:1px solid gray"&gt; &lt;asp:BulletedList runat="server" ID="blAvailableDocuments" Height="150px" BorderStyle="Solid" BorderWidth="1px" BorderColor="red"&gt; &lt;asp:ListItem Text="AvailableLI1"&gt; &lt;/asp:ListItem&gt; &lt;asp:ListItem Text="AvailableLI2"&gt; &lt;/asp:ListItem&gt; &lt;/asp:BulletedList&gt; &lt;/div&gt; &lt;div style="width:30%; display:table-cell; text-align:center"&gt; &lt;asp:Button runat="server" Text="&gt;&gt;" ID="btnAddAll" OnClientClick="AddAll(); return false" /&gt;&lt;br /&gt;&lt;br /&gt; &lt;asp:Button runat="server" Text="&lt;&lt;" ID="btnRemoveAll" OnClientClick="RemoveAll(); return false" /&gt; &lt;/div&gt; &lt;div style="width:35%; display:table-cell; border:1px solid gray"&gt; &lt;asp:BulletedList runat="server" ID="blSelectedDocuments" Height="150px" BorderStyle="Solid" BorderWidth="1px" BorderColor="Gray"&gt; &lt;asp:ListItem Text="SelectedLI1"&gt; &lt;/asp:ListItem&gt; &lt;asp:ListItem Text="SelectedLI2"&gt; &lt;/asp:ListItem&gt; &lt;/asp:BulletedList&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Simple right? theres also this JQuery here that allows the re-ordering within each list and the dragging and dropping between them.</p> <pre><code> $(function () { $("#ctl00_PlaceHolderMain_blAvailableDocuments").sortable(); $("#ctl00_PlaceHolderMain_blAvailableDocuments").disableSelection(); $("#ctl00_PlaceHolderMain_blSelectedDocuments").sortable(); $("#ctl00_PlaceHolderMain_blSelectedDocuments").disableSelection(); }); $(function () { $("#ctl00_PlaceHolderMain_blAvailableDocuments").draggable({ drag: function (event, ui) { if (ui.draggable[0].hasAttribute("ID")) { return; } } }); $("#ctl00_PlaceHolderMain_blAvailableDocuments").droppable({ drop: function (event, ui) { var source = ui.draggable[0].parentElement.id; var target = event.target.id; if (source != target) { Move(ui.draggable[0], source, target); } } }); $("#ctl00_PlaceHolderMain_blSelectedDocuments").draggable({ drag: function (event, ui) { if (ui.draggable[0].hasAttribute("ID")) { return; } } }); $("#ctl00_PlaceHolderMain_blSelectedDocuments").droppable({ drop: function (event, ui) { var source = ui.draggable[0].parentElement.id; var target = event.target.id; if (source != target) { Move(ui.draggable[0], source, target); } } }); }); function Move(element, from, to) { var fromBL = document.getElementById(from); var toBL = document.getElementById(to); var newLI = document.createElement("li"); newLI.innerHTML = element.innerHTML; fromBL.removeChild(element); toBL.appendChild(newLI); } </code></pre> <p>The condition whether the element has an ID is to stop the list itself from being dragged, I think it errors, which does what I need, but FYI the problem I have occurs without that.</p> <p>(Cant post pics here yet....... for a reason)</p> <p><a href="https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/946310_10151467867553519_1667792056_n.jpg" rel="nofollow">https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/946310_10151467867553519_1667792056_n.jpg</a></p> <p>Dragging and dropping works fine apart from... When I drag and drop so that there are no remaining ListItems in either one of the BulletedLists this happens.</p> <p><a href="https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/945900_10151467867548519_1597804249_n.jpg" rel="nofollow">https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/945900_10151467867548519_1597804249_n.jpg</a></p> <p>Any ideas, muchas grazias and danke for any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload