我正在尝试重新加载jqGrid
,但每次reload trigger of jqGrid
IE6
浏览器使用的内存会增加,浏览器会挂起一段时间。我也尝试过我的手机,我的手机被挂了,加载jqGrid Data
需要一些时间,经过reload
jqGrid
{移动浏览器jqGrid Version
后很长一段时间才会死机。
jquery Version
:4.4.3
jquery UI version
:1.7.2
server
:1.8.24
首先,我通过jquery
帖子向data
发出请求,然后我将jqGrid
传递给$.post(this.actionURL, this.postData, function (data) {
//my function is called to fill the jqGrid
}
以填充。
我的代码:
jqGrid
如果不存在,则创建this.jqGridView.jqGrid({
datatype: "jsonstring",
datastr: data,
loadui: "block",
jsonReader: { "repeatitems": false },
colNames: this.columnNames,
colModel: this.columnModel,
height: "auto",
gridview: true,
rowNum: '',
ignoreCase: true,
forceFit: true,
autowidth: false,
width: this.jqGridViewWidth,
loadComplete: function () {
}
});
:
jqGrid
如果jqGrid
存在,请重新加载 this.jqGridView.jqGrid("clearGridData");
this.jqGridView.jqGrid('setGridParam',
{
datatype: 'jsonstring',
datastr: data
})
.trigger("reloadGrid");
:
wbsCreate <- function(v) {
wb <- createWorkbook()
sheet <- createSheet(wb, "Sheet1")
rows <- createRow(sheet, rowIndex=1:5)
cells <- createCell(rows, colIndex=1:5)
for (r in 1:5)
for (c in 1:5)
setCellValue(cells[[r, c]], value = v[(r-1)*5+c])
saveWorkbook(wb, tf <- tempfile(fileext = ".xlsx"))
return(tf)
}
wbsMarkDiff <- function(fn1, fn2) {
fns <- c(fn1, fn2)
wb <- lapply(fns, loadWorkbook)
cs <- lapply(wb, function(x) CellStyle(x) +
Fill(backgroundColor="red",
foregroundColor="red",
pattern="SOLID_FOREGROUND"))
sheets <- lapply(wb, getSheets)
sheetnames <- do.call(intersect, lapply(sheets, names))
for (sheetname in sheetnames) {
sheet <- lapply(sheets, "[[", sheetname)
rows <- lapply(sheet, getRows)
cells <- lapply(rows, getCells)
values <- lapply(cells, function(cell) lapply(cell, getCellValue))
idx <- names(which(!mapply(identical, values[[1]], values[[2]])))
for (s in 1:2)
for (i in idx)
setCellStyle(cells[[s]][[i]], cs[[s]])
for (s in 1:2)
saveWorkbook(wb[[s]], fns[s])
}
}
library(xlsx)
# create to excel workbooks (same dimensions per sheet)
v <- LETTERS[1:25]
tf1 <- wbsCreate(v)
v[c(3,6,9)] <- letters[c(3,6,9)]
tf2 <- wbsCreate(v)
# mark differences
wbsMarkDiff(tf1, tf2)
shell.exec(tf1) # open file1 on windows
shell.exec(tf2) # open file2 on windows
问题: