6
« on: January 19, 2023, 02:31:00 am »
Hi Team,
I am using Paramquery pro v8.5
I am unable to resize the column even after setting the column.resizable to "True". I see that the cursor changes to "col-resize" on hover, however when I click and drag, column does not resize.
Below is the code, Thanks in advance
$(function () {
var pqIS = {
totalRecords: 0,
pending: true,
rpp: 25, //records per request.
init: function () {
this.data = [];
this.requestPage = 0;
}
};
pqIS.init();
var obj = {
selectionModel: { type: null },
scrollModel: {
autoFit: false
},
postRenderInterval: -1,
numberCell: { width: 50},
title: "Crew List",
virtualX: true, virtualY: true,
resizable: true,
filterModel: { on: true, header: true, type: 'remote' },
sortModel: { type: 'remote', sorter: [{ dataIndx: 'employeeNo', dir: 'up'}] },
beforeSort: function (evt) {
if (evt.originalEvent) {//only if sorting done through header cell click.
pqIS.init();
}
},
beforeTableView: function (evt, ui) {
var finalV = ui.finalV,
data = pqIS.data;
if (ui.initV == null) {
return;
}
if (!pqIS.pending && finalV >= data.length - 1 && data.length < pqIS.totalRecords) {
pqIS.requestPage++;
pqIS.pending = true;
//request more rows.
this.refreshDataAndView();
}
},
rowSelect: function (evt, ui) {
$("#Id").val(ui.addList[0].rowData.id);
}
};
obj.colModel = [
{ title: 'Select', align: 'center', editable: false,sortable: false, resizable: true,
render: function (ui) {
return "<input type='radio' name='radio100'/>";
},
postRender: function (ui) {
var grid = this;
$(ui.cell).find('input').prop('checked', ui.rowData.pq_rowselect).on('change', function (evt) {
grid.SelectRow().replace({ rowIndx: ui.rowIndx });
});
}
},
{ title: "Employee No", dataIndx: 'employeeNo', minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true },
{ title: "First Name", dataIndx: 'firstName' , minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true },
{ title: "Last Name", dataIndx: 'lastName', minWidth: 120,maxWidth: 200, align: "center" , sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true },
];
obj.dataModel = {
dataType: "JSON",
location: "remote",
url: "CrewListGrid.do",
postData: function () {
return {
pq_curpage: pqIS.requestPage,
pq_rpp: pqIS.rpp
};
},
getData: function (response) {
var data = response.data,
len = data.length,
curPage = response.curPage,
pq_data = pqIS.data,
init = (curPage ) * pqIS.rpp;
pqIS.pending = false;
pqIS.totalRecords = response.totalRecords;
for (var i = 0; i < len; i++) {
pq_data[i + init] = data;
}
window.scrollTo(0,document.body.scrollHeight);
return { data: pq_data }
},
error: function (jqXHR, textStatus, errorThrown) {
//alert("reached error");
//$(operationResponse).val("Error");
document.getElementById("gridCrewResult").innerHTML = "Failed to Reload Data, Please Try again";
//displayError("Failed to Reload Data", "errorId_crewlist");
}
};
$("#grid_infinite").pqGrid(obj);
});