顯示具有 jqGrid 標籤的文章。 顯示所有文章
顯示具有 jqGrid 標籤的文章。 顯示所有文章

2014年3月3日

jqGrid Reload

jQuery("#list2").jqGrid('setGridParam',{data: json_History}).trigger("reloadGrid");

jQuery("#list2").jqGrid('setGridParam',{url:"server.php?q=2"}).trigger("reloadGrid");
reference
    jqGrid: Reload Local Data or Url Data

2013年10月8日

jqGrid 展開 subGrid by other columns

ondblClickRow: function (rowid, iRow, iCol, e) {
    alert("rowid: " + rowid + ", iRow: " + iRow + ", iCol: " + iCol);
    if (iCol == 2) {
        $(this).jqGrid("toggleSubGridRow", rowid);
    }
},
onCellSelect: function (rowid, iCol, cellcontent, e) {
    alert("rowid: " + rowid + ", iCol: " + iCol + ", cellcontent" + cellcontent);
    if (iCol == 2) {
        $(this).jqGrid("toggleSubGridRow", rowid);
    }
},

2013年8月13日

jqGrid 換頁後, formatter失效

http://stackoverflow.com/questions/3807623/jqgrid-paging-question

$("#list").setGridParam({page:1}).trigger('reloadGrid');
$("#list").trigger("reloadGrid", [{page:1}]);
$("#list").trigger("reloadGrid", [{current:true}]);
使用無效?


用 bind綁定 click事件
$('td[id$=_pager]').click(function () {
    $('.buttonDownload').bind('click', Download);
});

function downloadButton(cellvalue, options, rowObject) {
    return "<input type='button' class='buttonDownload' value='列印' data-formTypeId='" +@Model.formTypeId +"' data-formNumber='" + cellvalue + "' />";
}

function Download() {
    var formTypeId = $(this).attr('data-formTypeId');
    var formNumber = $(this).attr('data-formNumber');
}
或 ...
function downloadButton(cellvalue, options, rowObject) {
    return "<input type='button' class='buttonDownload' onclick='javascript:Download(" + @Model.formTypeId + ", " + cellvalue + ");' value='列印' data-formTypeId='" +@Model.formTypeId +"' data-formNumber='" + cellvalue + "' />";
}

2012年9月17日

Grid can not be used in this quirks mode

應該是 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月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%");