This is a migrated thread and some comments may be shown as answers.

JQuery lib not working with telerik org chart

1 Answer 54 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Kranthi
Top achievements
Rank 1
Kranthi asked on 13 Aug 2013, 03:37 PM
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
    });
});

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter Filipov
Telerik team
answered on 16 Aug 2013, 06:15 AM
Hello Kranthi,

Thank you for contacting Telerik Support.

The RadOrgChart control uses jQuery and it serves the jQuery scripts when it loads on the page. Here is how to get a reference to it:
var $ = $telerik.$;
Note: we are using 1.91. version of the jQuery library.

I will be glad to assist you further.

Regards,
Peter Filipov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
OrgChart
Asked by
Kranthi
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or