小编Pau*_*how的帖子

如何在jqGrid中编辑或添加新行

我的jqGrid可以很好地从我的数据库中提取数据,但是我无法理解Add New Row功能的工作原理.

现在,我可以编辑内联数据,但是我无法使用模态框创建新行.我错过了额外的逻辑,说"如果这是一个新行,将其发布到服务器端URL"而不是修改现有数据.(现在,点击提交只会清除表单并重新加载网格数据.)

文档指出Add New Row是:

jQuery("#editgrid").jqGrid('editGridRow',"new",{height:280,reloadAfterSubmit:false}); 
Run Code Online (Sandbox Code Playgroud)

但我不确定如何正确使用它.我花了很多时间研究演示,但他们似乎都使用外部按钮来激活新的行命令,而不是使用我想要的模态形式.

我的完整代码在这里:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jqGrid</title>  

<link rel="stylesheet" type="text/css" media="screen" href="../css/ui-lightness/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.css" />

<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="../js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="jquery.jqGrid.min.js" type="text/javascript"></script>
</head>
<body>
<h2>My Grid Data</h2>
<table id="list" class="scroll"></table>
<div id="pager" class="scroll c1"></div> 

<script type="text/javascript">
var lastSelectedId;

jQuery('#list').jqGrid({
url:'grid.php',
datatype: 'json',
mtype: 'POST',
colNames:['ID','Name', 'Price', 'Promotion'],
colModel:[    
   {name:'product_id',index:'product_id', width:25,editable:false},     
   {name:'name',index:'name', width:50,editable:true, …
Run Code Online (Sandbox Code Playgroud)

row add jqgrid new-operator

12
推荐指数
1
解决办法
6万
查看次数

在我的godaddy帐户上使用proxy.php文件的神秘dbboon文件夹

今天进行一些网络维护时,我注意到我的GoDaddy主机帐户在名为"dbboon"的根级别上有一个奇怪的新文件夹,里面有一个名为proxy.php的文件.它的代码如下所示,似乎是某种代理功能.

我有点困扰,因为我没有把它放在那里.我GOOGLE了这一切,以了解更多,但没有发现任何东西,除了代理文件碰巧也存储在pastebin.com:http://pastebin.com/PQsSPbCr

我打电话给GoDaddy,他们证实它属于他们,说它是由他们的高级托管组放在那里进行测试,但没有任何更多的信息.我觉得这一切都很奇怪:为什么他们会在我的文件夹中放一些东西而不给我一个单挑,为什么他们需要这样做呢?

有人对此有所了解吗?

<?php

$version = '1.2';

if(isset($_GET['dbboon_version'])) {
echo '{"version":"' . $version . '"}';
exit;
}

function dbboon_parseHeaders($subject) {

global $version;

$subject = trim($subject);
$parsed = Array();
$len = strlen($subject);
$position = $field = 0;
$position = strpos($subject, "\r\n") + 2;

while(isset($subject[$position])) {

$nextC = strpos($subject, ':', $position);
$fieldName = substr($subject, $position, ($nextC-$position));
$position += strlen($fieldName) + 1;
$fieldValue = NULL;

while(1) {
  $nextCrlf = strpos($subject, "\r\n", $position - 1);
  if(FALSE === $nextCrlf) {
    $t = substr($subject, …
Run Code Online (Sandbox Code Playgroud)

php

10
推荐指数
1
解决办法
4835
查看次数

VBScript(经典 ASP):尝试将当前目录的绝对路径输出到浏览器,但出现错误

我正在尝试使用经典 ASP 将当前目录的绝对路径打印到浏览器屏幕。(相当于 PHP 的 echo 命令)。

我在下面代码的最后一行收到此错误:“Microsoft VBScript 运行时错误 '800a01a8' 所需对象:'文档'/Research/ro.asp,第 17 行”

我尝试了几种不同的方法来打印到屏幕(如 WScript.StdOut.Write),它们也返回相同的错误。

我怀疑我的错误与它是一个对象的事实有关,并且对象需要不同的打印到屏幕的方法。

任何人对此有何想法?

示例文件.asp=

<%

Dim szCurrentRoot: szCurrentRoot= ""

'Create the File System Ojbect
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

'Get the Absolute Path of the current directory
szCurrentRoot = objFSO.GetParentFolderName(Server.MapPath(Request.ServerVariables("URL")))

'Print to the screen.  The following line is line 17 which causes the error
Document.Write(szCurrentRoot)
%>
Run Code Online (Sandbox Code Playgroud)

经过更多研究,我找到了我的问题的答案:

Response.Write(szCurrentRoot)

这种写入浏览器屏幕的方式是成功的。

vbscript asp-classic

2
推荐指数
1
解决办法
7199
查看次数

标签 统计

add ×1

asp-classic ×1

jqgrid ×1

new-operator ×1

php ×1

row ×1

vbscript ×1