- smartautocomplete.zip
- css
- ui-lightness
- images
- ui-bg_diagonals-thick_18_b81900_40x40.png
- ui-bg_diagonals-thick_20_666666_40x40.png
- ui-bg_flat_10_000000_40x100.png
- ui-bg_glass_100_f6f6f6_1x400.png
- ui-bg_glass_100_fdf5ce_1x400.png
- ui-bg_glass_65_ffffff_1x400.png
- ui-bg_gloss-wave_35_f6a828_500x100.png
- ui-bg_highlight-soft_100_eeeeee_1x100.png
- ui-bg_highlight-soft_75_ffe45c_1x100.png
- ui-icons_222222_256x240.png
- ui-icons_228ef1_256x240.png
- ui-icons_ef8c08_256x240.png
- ui-icons_ffd27a_256x240.png
- ui-icons_ffffff_256x240.png
- jquery-ui-1.8.17.custom.css
- Default.aspx
- Default.aspx.cs
- jquery-smartautocomplete.sln
- Scripts
- Site.master
- Site.master.cs
- Styles
- Web.config
- jquery-smartautocomplete_1.0.zip
- jquery-smartautocomplete 1.0
- css
- ui-lightness
- images
- ui-bg_diagonals-thick_18_b81900_40x40.png
- ui-bg_diagonals-thick_20_666666_40x40.png
- ui-bg_flat_10_000000_40x100.png
- ui-bg_glass_100_f6f6f6_1x400.png
- ui-bg_glass_100_fdf5ce_1x400.png
- ui-bg_glass_65_ffffff_1x400.png
- ui-bg_gloss-wave_35_f6a828_500x100.png
- ui-bg_highlight-soft_100_eeeeee_1x100.png
- ui-bg_highlight-soft_75_ffe45c_1x100.png
- ui-icons_222222_256x240.png
- ui-icons_228ef1_256x240.png
- ui-icons_ef8c08_256x240.png
- ui-icons_ffd27a_256x240.png
- ui-icons_ffffff_256x240.png
- jquery-ui-1.8.17.custom.css
- Default.aspx
- Default.aspx.cs
- Scripts
- Site.master
- Site.master.cs
- Styles
- Web.config
|
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script src="Scripts/smartautocomplete.js" type="text/javascript"></script>
<style>
.ui-autocomplete
{
max-height: 100px;
overflow-y: auto; /* prevent horizontal scrollbar */
overflow-x: hidden; /* add padding to account for vertical scrollbar */
padding-right: 20px;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete
{
height: 100px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
//Input for testing purposes
$("#inp").smartautocomplete({
getDataFunc: getData,
pageSize: 15,
autoFocus: true
});
//Input for testing purposes
$("#inp2").smartautocomplete({
getDataFunc: getData,
pageSize: 15,
autoFocus: true
});
});
//Function the SA plugin called when data is needed.
var getData = function (input, pageIndex, pageSize, callback) {
//In this example I use a WebMethod, but you can call anything from a local source to any web service.
PageMethods.GetData(input, pageIndex, pageSize, function (response) {
if (response) {
//Data is assumed to be received in a {label: , value: , ...} form, as needed by jqueryUI autocomplete. Of course, if you change the _renderItem function, you are free to modify this as you want
response = $.map(response, function (item) {
return {
label: item,
value: item
}
});
callback(response);
}
else callback();
});
};
</script>
<asp:ScriptManager ID="scriptManager" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<h2>
<input id="inp" type="text" style="width: 350px;" />
<input id="inp2" type="text" style="width: 350px;" />
</h2>
</asp:Content>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.