Closed MichaelSL closed 11 years ago
Its already in there
See renderjavascript and renderhtmlelements
Maybe it would be helpful to have some extensions to write the code into the page. Something like this:
public static class MvcJqGridExtensions
{
public static HtmlString RenderHtml(this MvcJqGrid.Grid grid)
{
return new HtmlString(grid.RenderHtmlElements());
}
public static HtmlString RenderJs(this MvcJqGrid.Grid grid, string gridId = null)
{
var resStr = grid.RenderJavascript();
if (gridId != null)
{
resStr.Replace("##gridid##", gridId);
}
return new HtmlString(resStr);
}
}
This is a feature request. Is it possible to split js code and html elements rendering? It can be useful when jquery library is referenced after the page contents. Now the helper produces the jQuery.ready handler with html table definition and jQuery library is not yet referenced.