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

[Solved] Telerik DropDownList inside of jQuery UI Dialog

6 Answers 88 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dmitriy
Top achievements
Rank 1
Dmitriy asked on 22 Nov 2010, 08:35 PM
Hello, there.
I have the following scenario.

Partial view:  Edit.ascx
<% Html.Telerik().DropDownList().Name("TelDropDown2").Items(items =>
   {
       items.Add().Text("Item 1").Value("val1");
       items.Add().Text("Item 2").Value("val2");
   }).Render(); %>

View:  Page.aspx
<input type="button" id="OpenWindow" value="Edit" />

Site.Master:
<% Html.Telerik().ScriptRegistrar().DefaultGroup(group =>
                                                 group.Combined(
false)
                                                      .Compress(
false)
                                                      .Add(
"jquery-ui-1.8.6.custom.min.js")
                                                      .Add(
"Common.js"))
                                   .OnDocumentReady(
"Common.Init()")
                                   .Render(); %>

And finally, Common.js:
var Common = function () {
    return {
        Init: function () {    
        
            $('#JqUiDialog').dialog({
                autoOpen: false,
                modal: true,
                width: 300,
                height: 280
            });
            $('#OpenWindow').bind('click', function () {
                $.ajax({
                    type: 'POST',
                    contentType: 'application/json; charset=utf-8',
                    url: '/Home/Edit',
                    data: {},
                    dataType: 'html',
                    success: function (result) {
                        $('#JqUiDialog').html(result);
                        $('#JqUiDialog').dialog('open');
                    },
                    error: function (xhr) {
                        //...
                    }
                });
            });
    };
} ();

So, when I click the button, an AJAX call is being made to the controller's Edit action.  The action returns partial view Edit.ascx.  Inside of Edit.ascx, I'm creating a Telerik DropDownList.  The javascript callback function sets the jQuery UI dialog content to whatever it receives from the controller.  In the opened dialog, the Telerik DropDownList renders fine, however, it does not get any Telerik javascript handlers such as "click".  Moreover, the tData expando attribute isn't set either.  I haven't tried it, but I'm pretty sure the same is true for any Telerik control rendered in the same way.  How can I make it work?

Thank you.

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 08:25 AM
Hi Dmitriy,

I suggest you check the troubleshooting help article. You can also check the using with partial views help article.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dmitriy
Top achievements
Rank 1
answered on 23 Nov 2010, 03:54 PM
Atanas.

These links point to empty pages.  Maybe you got some kind of maintenance going on at the moment?  All I see is
"Telerik Extensions for ASP.NET MVC" in the upper left corner and a search box in the upper right.

Thanks.

Dmitriy
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 04:32 PM
Hi Dmitriy,

 I checked the links and they appear correctly. I am not sure what is going on at your end. What browser are you using? I tested those pages in IE7/8, Chrome and Firefox.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dmitriy
Top achievements
Rank 1
answered on 23 Nov 2010, 04:45 PM
I'm on FireFox.  Here is what Console says when I go to those pages:

Telerik.Web.UI.RadTreeView is undefined

Thanks
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 04:49 PM
Hi Dmitriy,

 I cannot reproduce this error using the latest firefox. Could it be some firefox plugin? Anyway you can use the compiled documentation (.CHM) file which is shipped with the installation.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dmitriy
Top achievements
Rank 1
answered on 23 Nov 2010, 05:00 PM
Alright, let me take a look!

Thank you.
Tags
ComboBox
Asked by
Dmitriy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Dmitriy
Top achievements
Rank 1
Share this question
or