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

Not able to call javascript method defined in RadCodeBlock

0 Answers 91 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Dheeraj
Top achievements
Rank 1
Dheeraj asked on 22 Feb 2013, 10:14 AM
Hi, 
I have a method defined in RadCodeBlock, when i am trying to call it on page load(by pushing my method in _spBodyOnLoadFunctionNames), i am getting error : The value of the property 'MyMethod' is null or undefined, not a Function object.

(Note: I am using RadComboBox with Sharepoint 2010.)

Below is the scenerio:
<telerik:RadCodeBlock ID="RadCodeBlock" runat="server">
    <script type="text/javascript">
            function pageLoad() {
               GetComboBox = function () {
                    var combo = $find("<%= MyRadComboBox.ClientID %>");
                    return combo;
                };
            };
    </script>                    
</telerik:RadCodeBlock>


Method2 = function(){
var combo = GetComboBox(); -->// getting error
// do something
}
 
var index = ko.utils.arrayIndexOf(_spBodyOnLoadFunctionNames, "Method2");
if( index === -1) {
    _spBodyOnLoadFunctionNames.push("Method2");
}

 ERROR : The value of the property 'GetComboBox' is null or undefined, not a Function object.

No answers yet. Maybe you can help?

Tags
Sharepoint Integration
Asked by
Dheeraj
Top achievements
Rank 1
Share this question
or