我创建了一个包含一些字段的jqGrid,例如:
job_id,名称等
我要做的是使得当点击job_id列中的值时,它会将它们重定向到:
job.php?job_id =(他们点击的值)
我开始尝试使用以下作为我的colModel:
{ name:'job_id', index:'job_id', edittype:'select', formatter:'showlink',
formatoptions:{baseLinkUrl:'job.php'}, width:50, align:'center' }
Run Code Online (Sandbox Code Playgroud)
但是这会导致重定向到:
job.php?JOB_ID =(ROW_ID)
我做了一些搜索,发现这个软件的开源版本开发人员的帖子建议使用以下colModel和其他JS:
{ name:'job_id', index:'job_id', edittype:'select', formatter:'showlink',
formatoptions:{baseLinkUrl:'#'}, width:50, align:'center' }
loadComplete: function() {
var myGrid = $("#home_list");
var ids = myGrid.getDataIDs();
for (var i = 0, idCount = ids.length; i < idCount; i++) {
$("#"+ids[i]+" a",myGrid[0]).click(function(e) {
var hash=e.currentTarget.hash;// string like "#?id=0"
if (hash.substring(0,5) === '#?id=') {
var id = hash.substring(5,hash.length);
var text = this.textContent;
location.href="job.php?id="+text;
}
e.preventDefault();
});
}
}
Run Code Online (Sandbox Code Playgroud)
但这与IE不兼容.除此之外,当在jqGrid中显示大量行时,加载需要很长时间,比如5秒+ …
我们使用以下方法将URL映射文件加载到HAProxy中:
http-request redirect location %[capture.req.uri,map(/etc/haproxy/redirects.map)] code 301 if { capture.req.uri,map(/etc/haproxy/redirects.map) -m found }
Run Code Online (Sandbox Code Playgroud)
地图文件中一行的示例为:
/shop-by-category /products
Run Code Online (Sandbox Code Playgroud)
此重定向按预期工作。我遇到的唯一问题是使用/ shop-by-category路径传递查询字符串时。例如:
/shop-by-category?testingquerystring=test
Run Code Online (Sandbox Code Playgroud)
这不会重定向。
我尝试将我认为是HAProxy查询变量的内容添加到重定向映射中,例如:
/shop-by-category&%[query] /parts&%[query]
Run Code Online (Sandbox Code Playgroud)
但是,HAProxy在地图文件中似乎无法识别出这一点。有什么方法可以让HAProxy动态识别查询字符串并在重定向时将其传递通过?
好的,我在桌子上有一排.此行有八个日期类型字段.
我正在尝试编写一个返回行中最高日期值的查询.
例如:
NULL,NULL,2009-10-09,2010-03-12,2010-04-15,2010-06-23,2010-08-27,NULL
Run Code Online (Sandbox Code Playgroud)
针对上表运行时的查询将返回此行的以下值:2010-08-27
我尝试了几种使用CASE的组合,但它似乎不够优雅和冗长(因此我还没有完成编写查询).
我还有其他选择吗?或者有人有一个他们已成功运行的解决方案?
感谢任何可以提供的帮助.:)