javascript - Can I put Ignite UI scripts at the bottom of the page? -
the ignite ui boilerplate has javascript files loaded @ top of page. consistent every other example can find on infragistics site.
i'd load these files @ bottom of page instead. however, when seek javascript error:
referenceerror: $ not defined
on view, utilize grid html helper (simplified):
@model iqueryable<product> @( html.infragistics().grid( model ).databind().render() )
this produces next output on page:
<table id="grid1"></table> <script type="text/javascript">$(function () {$('#grid1').iggrid({ ... });</script>
if tell infragistics set script
tag @ bottom of page, after load jquery, jquery ui, etc., peachy. there way can , still utilize html helpers?
you can refer javascript resources using infragistics loader.
in cshtml have :
<script src="scripts/infragistics.loader.js" type="text/javascript"></script>
and in script tag have next :
$.ig.loader({ scriptpath: '{ig resources root}/js/', csspath: '{ig resources root}/css/'}); $.ig.loader('iggrid.paging.updating', function () { // create couple of iggrids $("#grid1").iggrid({ virtualization: false, autogeneratecolumns: true, jquerytemplating: false, // , other}
read more here : http://help.infragistics.com/help/doc/jquery/2013.1/clr4.0/html/deployment_guide_javascript_resources.html#referencing_resources
javascript asp.net-mvc-4 razor infragistics ignite-ui
No comments:
Post a Comment