1
Help for ParamQuery Grid (free version) / Re: A problem with ASP.net Webforms
« on: March 21, 2016, 08:16:44 pm »
Thanks for your tips,I think i know how to solve it .
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
function ListGrid(obj) {
var _sex=obj;
//paramters
var _postData = {"Sex": _sex };
//url
var _url = "UserInfo.aspx?action=GridBindList";
//colM:grid title
var _colM = [
{ title: "UserID", width: 100, dataType: "integer", dataIndx: "UserID" },
{ title: "UserName", width: 100, dataType: "string", dataIndx: "UserName" },
{
title: "Sex", width: 150, dataType: "integer", dataIndx: "Sex",
render: function (ui) {
var rowData = ui.rowData;
var value = rowData["Sex"];
if (value == "0") {
return "Female";
}
else{
return "Male";
}
}
}
];
PQLoadGrid("#grid_paging", _url, _colM, _postData, 20);
}
/*
a function that it is used to get data into PQ grid from server
obj_ID:Container ID
*/
function PQLoadGrid(obj_ID, _url, _colM, _postData, _pageSize) {
var dataModel = {
location: "remote",
paging: "remote",
dataType: "JSON",
method: "GET",
postData: _postData,
url: _url + "&a=" + new Date(),
getData: function (dataJSON, textStatus, jqXHR) {
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
}
}
var grid = $(obj_ID).pqGrid({
width: 900,
height: 400,
collapsible: false,
dataModel: dataModel,
colModel: _colM,
freezeCols: 0,
wrap: true,
hwrap: false,
numberCell: { resizable: true, width: 30, title: "No" },
oddRowsHighlight: true,
columnBorders: true,
pageModel: { type: "remote", rPP: _pageSize, rPPOptions: [20, 50, 100] },//, strRpp: "{0}",
editable: false
});
}
And html code as below: <div onclick="ListGrid(0)">Female</div>
<div onclick="ListGrid(1)">Male</div>
<div id="grid_paging" style="margin-top: 1px;"></div>
Looking forward to your reply !