Added in-style dropdown control
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DropDown.ascx.cs" Inherits="Swarmops.Frontend.Controls.v5.Base.DropDown" %>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#<%=this.DropControl.ClientID %>').combobox({
|
||||
animate: true,
|
||||
height: 30
|
||||
});
|
||||
|
||||
$('#<%=this.DropControl.ClientID %> span.combo input.combo-text').click(function () {
|
||||
$('#<%=this.DropControl.ClientID %> span.combo span span.combo-arrow').click();
|
||||
});
|
||||
|
||||
$('#<%=this.DropControl.ClientID %>_SpanBudgets span.combo input.combo-text').keydown(function (e) {
|
||||
switch (e.which) {
|
||||
case 40: // down
|
||||
$('#<%=this.DropControl.ClientID %>_SpanBudgets span.combo span span.combo-arrow').click();
|
||||
break;
|
||||
|
||||
default: return; // exit this handler for other keys
|
||||
}
|
||||
e.preventDefault(); // prevent the default action (scroll / move caret)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<asp:DropDownList ID="DropControl" runat="server" />
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace Swarmops.Frontend.Controls.v5.Base
|
||||
{
|
||||
public partial class DropDown : ControlV5Base
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ListItemCollection Items
|
||||
{
|
||||
get { return this.DropControl.Items; }
|
||||
}
|
||||
|
||||
public string SelectedValue
|
||||
{
|
||||
get { return this.SelectedValue; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user