2016-06-14 59 views
0

如何從列表框中選擇多個項目而無需使用javascript按下CTRL鍵?如何從列表框中選擇多個項目asp.net,而無需使用javascript按下CTRL鍵?

<asp:ListBox ID="Satellites" runat="server" AppendDataBoundItem="true" AutoPostBack="true" onchange='GetValueSatellite();' Width="400px" SelectionMode="Multiple"></asp:ListBox> 
+0

如果你想自定義行爲,那麼你可能必須建立一個自定義工具。我曾有一位老闆想要一個多選列表框,每行都有一個小複選框。我不得不爲此創建一個自定義工具,但它工作得很好。 – nurdyguy

回答

1
$('option').mousedown(function (e) { 
    e.preventDefault(); 
    $(this).prop('selected', $(this).prop('selected') ? false : true); 
    return false; 
}); 
相關問題