joeharrison714 / MVCGrid.Net

http://mvcgrid.net
MIT License
74 stars 55 forks source link

MVCGrid is not defined #56

Open khalome opened 8 years ago

khalome commented 8 years ago

When following the examples at http://mvcgrid.net/demo/export I continue to get the same error in javascript: Uncaught ReferenceError: MVCGrid is not defined Any idea why this happens and how to solve it. Below is my code in the view. The grid renders fine by the way.

Export to CSV

@Html.MVCGrid("UsersGrid")

@section scripts{

<script type="text/javascript">
    $(function () {
        $('#exportButton').click(function () {
            location.href = MVCGrid.getExportUrl('UsersGrid');
        });
    });
</script>

}

khalome commented 8 years ago

Code fails at:

location.href = MVCGrid.getExportUrl('UsersGrid');

joeharrison714 commented 8 years ago

Hi, Did you include the javascript reference as mentioned in the getting started guide? http://mvcgrid.net/gettingstarted

Thanks, Joe