I have a telerik grid in an asp.net mvc3 (RAZOR) View. While designing I had also bind OnDataBound client event.
@{
Html.Telerik().Grid()
.Name("someGrid")
.clientEvents(e=>e.OnDataBound("someGrid_onDataBound"))
.Render();
}
<script>
function someGrid_onDataBound(e){
//.. some code which needs to access a function from a JavaScript closure.
}
</script>
In the view I have linked a JavaScript file which contains a Closure for performing different actions. and in the function above I need to call some function from the closure, for this I need to declare this function inside the closure.
Can anybody tell me please how could I make “someGrid_onDataBound” [grid event handler] to access some function from the closure.
in the closure you have to add the said javascript function to window as follows.
// here is your out of closure function
window.someGrid_onDataBound = function(e){
}
})(jQuery);