Hi,
i'm using org chart control to build employee hierarchy.
one of our web application contains search page with asp.ne text box where users will search others hierarchy by last name.
i'm using JQUERY auto complete to populate employee last names from sql table
i created a new file with name search.js and pasted below code
my search page contains below telerik controls
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<telerik:RadOrgChart ID="RadOrgChart1" >
<telerik:RadListBox ID="RadListBox1">
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
---------------------------------------------------------- search.js file code-----------------
var searchbutton;
jQuery(document).ready(function() {
searchbutton = jQuery('[id$="_tbAuto"]');
$(searchbutton).watermark('Type Last Name', { useNative: false, className: 'innercolor' });
});
$(function () {
$(".tb").autocomplete({
source: function (request, response) {
$.ajax({
url: "EmployeeList.asmx/GetEmployeeInfo",
data: "{ 'mail': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item.EmployeeLastName
}
}))
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("There was a search error please contact admin");
}
});
},
minLength: 2
});
});
i'm using org chart control to build employee hierarchy.
one of our web application contains search page with asp.ne text box where users will search others hierarchy by last name.
i'm using JQUERY auto complete to populate employee last names from sql table
i created a new file with name search.js and pasted below code
my search page contains below telerik controls
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<telerik:RadOrgChart ID="RadOrgChart1" >
<telerik:RadListBox ID="RadListBox1">
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
---------------------------------------------------------- search.js file code-----------------
var searchbutton;
jQuery(document).ready(function() {
searchbutton = jQuery('[id$="_tbAuto"]');
$(searchbutton).watermark('Type Last Name', { useNative: false, className: 'innercolor' });
});
$(function () {
$(".tb").autocomplete({
source: function (request, response) {
$.ajax({
url: "EmployeeList.asmx/GetEmployeeInfo",
data: "{ 'mail': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item.EmployeeLastName
}
}))
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("There was a search error please contact admin");
}
});
},
minLength: 2
});
});