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

"ScriptRegistrar().OnDocumentReady()" only works one time

0 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andreas
Top achievements
Rank 1
Andreas asked on 31 Aug 2011, 04:20 PM
Hello,

I have a view where I use "ScriptRegistrar().OnDocumentReady()" to output some JavaScript.  That works just fine and gets rendered in the "jQuery(document).ready(...)".  Now I have a partial view that gets rendered in a Telerik Window via "detailsDialog.ajaxRequest("/Admin/User/DetailsBox/" + userId);".  In this partial view I call

@{ Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("~/Scripts/b4.jquery.multiselect.js")); }

to include a JavaScript file and 

@{
    Html.Telerik().ScriptRegistrar().OnDocumentReady(
        @<text>
            $("assignedRoles").multiselect(
                                            checkAllText     = @_("RuleSelector.CheckAll.Text"),
                                            uncheckAllText   = @_("RuleSelector.UncheckAll.Text"),
                                            noneSelectedText = @_("RuleSelector.NoneSelected.Text"),
                                            selectedText     = @_("RuleSelector.SelectedText.Text")
                                         );
        </text>);
}


to add some more stuff to the  "jQuery(document).ready(...)".  These two items are not rendered.  There is no include for that script file and the JavaScript code is not added to the document ready method.

What is the problem?
Tags
General Discussions
Asked by
Andreas
Top achievements
Rank 1
Share this question
or