1
Help for ParamQuery Pro / Re: load data on button click
« on: January 14, 2014, 12:53:55 am »
That works great. Thanks!
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.
dataModel: {
dataType: "JSON",
location: "remote",
recIndx: "ID",
url: "/PCA/PCAData",
getData: function (response) {
return { data: response };
}
},
$('#search').click(function()
{
$( "#jsongrid" ).pqGrid("option","dataModel.getData",function( response, textStatus, jqXHR ){});
});
It can be saved in $detailGrid as $detailGrid.data('rowData') for later use.
init: function (ui) {
var rowData = ui.rowData,
id = rowData["ID"];
I want to get this id from inside the addRowDetail($grid) function so I can supply this id from the main(parent) grid to the added row in the detail grid. var ajaxObj = {
dataType: "JSON",
beforeSend: function () {
this.pqGrid("showLoading");
},
complete: function () {
this.pqGrid("hideLoading");
},
error: function () {
this.pqGrid("rollback");
}
};
function editRowDetail(rowIndx) {
$grid.pqGrid("addClass", { rowIndx: rowIndx, cls: 'pq-row-edit' });
$grid.pqGrid("editFirstCellInRow", { rowIndx: rowIndx });
How do I refer to the detail grid here instead of the main grid. init: function (ui) {
var rowData = ui.rowData,
id = rowData["ID"];
//make a deep copy of gridDetailModel
var objCopy = $.extend(true, {}, gridDetail);
objCopy.dataModel.url = "/" + id;
objCopy.dataModel.error = function () {
$gridMain.pqGrid("rowInvalidate", {rowData:rowData});
};
var $grid = $("<div></div>").pqGrid(objCopy);
return $grid;
}
Later on in my code I reference the main grid like this var $grid = $("#jsongrid").pqGrid(gridMain);
var dataModel = {//define datamodel and get data from server
cache: true,
location: "remote",
paging: "remote",
sorting: "local",
sortDir: "down",
//rPP: 20,
//rPPOptions: [10, 20, 40],
dataType: "JSON",
getUrl: function () {
return { url: "/PCA/PCAData/" };
},
getData: function (dataJSON, textStatus, jqXHR ){
return { data: dataJSON };
}
};