Forum


18:36

17/02/2010

I've got a very simple form that has a jqGrid 3.6.4 on it. I've stripped out everything I thought might be an issue - it's nothing more than a grid and a few buttons. The problem I'm running into is when I click on the Add button the entire grid is shifted down (usually by the height of the popup). Here's a sample page to show what I'm talking about:
<html>
<head>
<link rel="stylesheet" media="screen" href="/css/ui.jqgrid.css" />
<link rel="stylesheet" media="screen" href="/css/themes/black-tie/jquery-ui.css" />
<script src="/js/jquery-1.3.2.min.js"></script>
<script src="/js/i18n/grid.locale-en.js"></script>
<script src="/js/jquery.jqGrid.min.js"></script>
<script>
$(document).ready(function () {
$("#grdInvoice").jqGrid({
url: 'http://localhost/GetInvoice.htm',
datatype: "json",
colNames: ['Category', 'Part #', 'Description', 'Cost', 'PK'],
colModel: [
{ name: 'Category', index: 'Category', width: 110, editable: true, edittype:"select", editoptions: {value:"A:A;B:B"} },
{ name: 'PartNumber', index: 'PartNumber', width: 170, editable: true, editoptions: { size: 20} },
{ name: 'Description', index: 'Description', width: 200, editable: true, editoptions: { size: 30} },
{ name: 'Cost', formatter: 'currency', align: "right", formatoptions: { prefix: "$" }, index: 'Cost', width: 95, editable: true, editoptions: { size: 10} },
{ name: 'PK', hidden: true, editable: false}
],
caption: "Invoice",
viewrecords: true,
cellsubmit: 'clientArray',
editurl: "http://localhost/Nothing.htm"
});
$("#btnAdd").click(function () {
$("#grdInvoice").jqGrid('editGridRow', "new", { height: 200, width:400, reloadAfterSubmit: false });
});
$("#btnEdit").click(function() {
var selRow = $("#grdInvoice").jqGrid("getGridParam", "selrow");
if (selRow != null)
$("#grdInvoice").jqGrid("editGridRow", selRow);
else
alert("Please select a row.");
});
$("#btnDelete").click(function() {
var selRow = $("#grdInvoice").jqGrid("getGridParam", "selrow");
if (selRow != null)
$("#grdInvoice").jqGrid("delGridRow", selRow);
else
alert("Please select a row.");
});
});
</script>
</head>
<body>
<input value="Add" />
<input value="Edit" />
<input value="Delete" />
<table />
</body>
</html>
Here's what the JSON data looks like:
{"total":"2","page":"1","records":"2","userdata":{"Customer":"Total","Amount":0.00,"Paid":0},"rows":[{"id":"0","cell":["2/15/2010","ABC123 ","55555","Mr. Sample Customer","0.00","0","Open","/Invoice.aspx"]},{"id":"1","cell":["2/17/2010","ABC124 ",null,"Mrs. Another Sample","0.00","0","Open","/Invoice.aspx"]}]}
12:46

Moderators
30/10/2007

Hello,
read carfully the docs.
http://www.trirand.com/jqgridw.....to_install
You will need to add DOCTYPE
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
81 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66