應該是 DOCTYPE非正規導致
ex:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
=>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
jqGrid not rendered when the html page containing the grid is loaded through an ajax call
2012年9月17日
2012年9月14日
jqGrid on IE7 IE8
jqGrid 4.4.1 load data at once
在 IE8以下 高度會過長、pager會被蓋住看不到
solution:
用 3.7.2版本
&
$('.ui-jqgrid-bdiv').css("height", "89%");
$("#jqgridRaw").jqGrid("setGridHeight", "90%");
Ajax 後 網頁重新導向
async
類型:Boolean
默認值: true。
默認設置下,所有請求均為異步請求。如果需要發送同步請求,請將此選項設置為 false。
注意,同步請求將鎖住瀏覽器,用戶其它操作必須等待請求完成才可以執行。
$.ajax({
url: '/usercontrols/ExportHighchartPhotoServices.ashx',
type: 'POST',
async: false,
data: { ... },
error: function (xhr, ajaxOptions, thrownError) {
...
},
success: function (response) {
...
}
});
jQuery ajax - ajax() 方法
2012年9月13日
錯誤訊息 Could not load file or assembly 'Svg ... '
Could not load file or assembly 'Svg, Version=0.5.2.17984, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
可能是 dll沒找到、版本錯誤等
連 dll都沒進去,當然沒進入 function,也不會有 catch
2012年9月12日
EPPlus Worksheet Name
EPPlus Worksheet Name 不能有問號 '?'
ExcelWorksheet Worksheet = Package.Workbook.Worksheets.Add(dt.TableName.Replace("?", ""));
2012年9月11日
Highchart Serverside Export
構想
1.在 client自動產、存圖後
後台程式 再撈出圖片 塞進 iTextSharp
2.把參數傳回後台,再呼叫自己寫的 webservice
ws再呼叫 export module.axd
傳回圖片的 string/stream,再塞進 iTextSharp
1.在 client自動產、存圖後
後台程式 再撈出圖片 塞進 iTextSharp
2.把參數傳回後台,再呼叫自己寫的 webservice
ws再呼叫 export module.axd
傳回圖片的 string/stream,再塞進 iTextSharp
2012年9月4日
jQuery 字串取代 replace
"Hello".replace(/ll/g,"qq");
var reg = new RegExp(billNumber + ',', 'g');
$("#number").html($("#number").html().replace(reg, ''));
replaceAll是用於取代元件
2012年9月3日
css hack for IE
padding:10px;
padding:9px\9; /* all ie */
padding:8px\0; /* ie8-9 */
*padding:5px; /* ie6-7 */
+padding:7px; /* ie7 */
_padding:6px; /* ie6 */
Ref:IE6-IE9 CSS hack 寫法
2012年8月31日
jQuery Table 欄位合併
jQuery : 分享合併Table的欄位 (RowSpan、ColSpan) 語法
CODE-以jQuery實現Table相同欄位的上下合併
////合併上下欄位(colIdx)
jQuery.fn.rowspan = function(colIdx) {
return this.each(function() {
var that;
$('tr', this).each(function(row) {
var thisRow = $('td:eq(' + colIdx + '),th:eq(' + colIdx + ')', this);
if ((that != null) && ($(thisRow).html() == $(that).html())) {
rowspan = $(that).attr("rowSpan");
if (rowspan == undefined) {
$(that).attr("rowSpan", 1);
rowspan = $(that).attr("rowSpan");
}
rowspan = Number(rowspan) + 1;
$(that).attr("rowSpan", rowspan);
$(thisRow).remove(); ////$(thisRow).hide();
} else {
that = thisRow;
}
that = (that == null) ? thisRow : that;
});
alert('1');
});
}
////當指定欄位(colDepend)值相同時,才合併欄位(colIdx)
jQuery.fn.rowspan = function(colIdx, colDepend) {
return this.each(function() {
var that;
var depend;
$('tr', this).each(function(row) {
var thisRow = $('td:eq(' + colIdx + '),th:eq(' + colIdx + ')', this);
var dependCol = $('td:eq(' + colDepend + '),th:eq(' + colDepend + ')', this);
if ((that != null) && (depend != null) && ($(thisRow).html() == $(that).html()) && ($(depend).html() == $(dependCol).html())) {
rowspan = $(that).attr("rowSpan");
if (rowspan == undefined) {
$(that).attr("rowSpan", 1);
rowspan = $(that).attr("rowSpan");
}
rowspan = Number(rowspan) + 1;
$(that).attr("rowSpan", rowspan);
$(thisRow).remove(); ////$(thisRow).hide();
} else {
that = thisRow;
depend = dependCol;
}
that = (that == null) ? thisRow : that;
depend = (depend == null) ? dependCol : depend;
});
});
}
////合併左右欄位
jQuery.fn.colspan = function(rowIdx) {
return this.each(function() {
var that;
$('tr', this).filter(":eq(" + rowIdx + ")").each(function(row) {
$(this).find('th,td').each(function(col) {
if ((that != null) && ($(this).html() == $(that).html())) {
colspan = $(that).attr("colSpan");
if (colspan == undefined) {
$(that).attr("colSpan", 1);
colspan = $(that).attr("colSpan");
}
colspan = Number(colspan) + 1;
$(that).attr("colSpan", colspan);
$(this).remove();
} else {
that = this;
}
that = (that == null) ? this : that;
});
});
});
}
CODE-以jQuery實現Table相同欄位的上下合併
<script type="text/javascript">
$(function () {
//模擬顯示資料
var data =
[
{ No: "1", Name: "Jeffrey", Date: "2011/05/07", Score: 2011 },
{ No: "1", Name: "Jeffrey", Date: "2011/06/21", Score: 9999 },
{ No: "1", Name: "Jeffrey", Date: "2011/06/22", Score: 32767 },
{ No: "2", Name: "Mulder", Date: "2011/06/01", Score: 999 },
{ No: "3", Name: "Darkthread", Date: "2011/06/10", Score: 100 },
{ No: "3", Name: "Darkthread", Date: "2011/06/15", Score: 100 }
];
var h = [];
for (var i = 0; i < data.length; i++) {
h.push("<tr>");
var obj = data[i];
for (var p in obj)
h.push("<td class='c-" + p + "'>" + obj[p] + "</td>");
h.push("</tr>");
}
$("#scoreboard tbody").html(h.join('\n'));
//合併內容相同欄位的邏輯
$("#btnShowMe").click(function () {
var $lastCell = null;
var mergeCellSelector = ".c-No,.c-Name";
$("#scoreboard tbody td.c-No").each(function () {
//跟上列的td.c-No比較,是否相同
if ($lastCell && $lastCell.text() == $(this).text()) {
//取得上一列,將要合併欄位的rowspan + 1
$lastCell.closest("tr").children(mergeCellSelector)
.each(function () {
this.rowSpan = (this.rowSpan || 1) + 1;
});
//將本列被合併的欄位移除
$(this).closest("tr").children(mergeCellSelector).remove();
}
else //若未發生合併,以目前的欄位作為上一欄位
$lastCell = $(this);
});
});
});
</script>
<table id="scoreboard">
<thead>
<tr><td>No</td><td>Name</td><td>Date</td><td>Score</td></tr>
</thead>
<tbody>
</tbody>
</table>
void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].CssClass="SubProjectTd";
// 在每一個 row的第一個 column加上 class
}
}
2012年8月30日
jQuery Multi Select 動態預設多選
如果選項是用 javascript在前台塞進去的
想要預選就得先將 select元件設定 multiple
想要預選就得先將 select元件設定 multiple
$("#ddlSurvey").attr("multiple", "multiple");
$("#ddlSurvey").multiselect({...});
$("#ddlSurvey").multiselect('refresh');
2012年8月28日
Windows 虛擬桌面 Desktops v1.02
http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx
http://download.sysinternals.com/files/Desktops.zip
http://download.sysinternals.com/files/Desktops.zip
Highchart 沒有顯示圖
有框 沒圖
1. 設定變數時,數字給成字串
ex: var hy_legend_y = "50";
IE還是可以顯示;Chrome、Firefox就不能
2. Highcharts line chart does not work with jQuery 1.7.
highchart not shown data graph
1. 設定變數時,數字給成字串
ex: var hy_legend_y = "50";
IE還是可以顯示;Chrome、Firefox就不能
2. Highcharts line chart does not work with jQuery 1.7.
highchart not shown data graph