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

[Solved] Client-side create failure

1 Answer 130 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
FinallyInSeattle
Top achievements
Rank 1
FinallyInSeattle asked on 16 Nov 2011, 12:57 AM
I've created click method that dynamically creates a window.
$("#buttonProductCatalog").click(function (e) {
    e.preventDefault();
 
    if (productCatalog == null) {
        productCatalog = $.telerik.window.create({
            name: "ProductCatalog",
            title: "Product Catalog",
            contentUrl: '@Url.Action("ProductDialog", "Product")',
            modal: true,
            draggable: true,
            width: 900,
            height: 600,
 
            onClose: function (e) {
              productCatalog_onClose();
            }
 
        });
    }
    $('#ProductCatalog').data('tWindow').center().open();
})

When I click the button, I get the error "Unable to get value of the property 'create': object is null or undefined".  I've added the references to the script files as shown below to the top of my partial view and get the same error.
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("telerik.common.min.js")
.Add("telerik.draganddrop.min.js")
.Add("telerik.window.min.js")))

I've also tried adding these same script files to my ScriptRegistrar statement in Layout.cshtml instead of adding them to the partial view.
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("telerik.common.min.js")
                                                          .Add("telerik.draganddrop.min.js")
                                                          .Add("telerik.window.min.js")
                                                             .Combined(true)
                                                             .CacheDurationInDays(5)
                                                             .Compress(true))
                                                             .Globalization(true)
                                                             .jQuery(false)
                                                             )

I still get the same error.  What am I doing wrong with regards to getting the appropriate js files loaded?





1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 17 Nov 2011, 11:29 AM
Hello Lori,

We tried this scenario with the Q3 release and it seems that the problem does not appear (test project attached). Do you mind upgrading? There are lots of fixes in it.

Greetings,
Alex Gyoshev
the Telerik team
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Window
Asked by
FinallyInSeattle
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or