Here the syntax I am using for appending text.
$("#table").append("<span>Append some text here..</span>");
I have a view like this
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<JQGridMVCExamples.Models.OrdersJqGridModel>" %>
<%@ Import Namespace="Trirand.Web.Mvc" %>
<%@ Import Namespace="JQGridMVCExamples.Models" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Performance Linq</title>
<script type="text/javascript" src="http://www.trirand.net/aspnetmvc/Scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://www.trirand.net/aspnetmvc/Scripts/jqgrid/i18n/grid.locale-en.js"></script>
<script type="text/javascript" src="http://www.trirand.net/aspnetmvc/Scripts/jqgrid/jquery.jqGrid.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.trirand.net/aspnetmvc/Content/themes/redmond/jquery-ui-1.7.1.custom.css" />
<link rel="stylesheet" type="text/css" href="http://www.trirand.net/aspnetmvc/Content/themes/ui.jqgrid.css" />
</head>
<body>
<div>
<%= Html.Trirand().JQGrid(Model.OrdersGrid, "JQGrid1") %>
</div>
<br /><br />
<div>
<% Html.RenderPartial("CodeTabs"); %>
</div>
</body>
</html>
Where do I need to keep this append in the view so that I can see the text top of the grid?
If you are trying to inject the
<span>above your table, you should use jQuery’s prepend rather than append, and you need to give the targetdivthe id you are using in the prepend function.So where you have
(assuming this is your target div), make that