ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: Eagle_f90 on January 29, 2016, 07:55:12 pm
-
I have a specified width set for all my columns but one. The hope was that the one column with no set width would auto expand/shrink depending on the size of the table, unfortunately it is not. No matter what I seem to do the final column, which has a set width, will always expand/shrink to fill the table instead of column 10 (the column with no set width). How do I make it so column 10 expands/shrinks and not the last column?
var colModel = [
{ title: "Project ID", dataType: "integer", dataIndx: "ID", hidden: true },
{ title: "Project Name", dataType: "string", dataIndx: "Name", resizable: true, width: 200, halign: "center" },
{ title: "Notes", dataType: "string", resizable: false, width: 75, halign: "center" },
{ title: "Change Type", dataType: "string", dataIndx: "Type", resizable: true, width: 169, halign: "center" },
{ title: "Priority", dataType: "string", dataIndx: "Priority", resizable: true, width: 55, halign: "center" },
{ title: "Impact", dataType: "string", dataIndx: "Impact", resizable: true, width: 55, halign: "center" },
{ title: "Assigned To", dataType: "string", dataIndx: "AssignedTo", resizable: true, width: 150, halign: "center" },
{ title: "Estimated Start Date", dataType: "date", dataIndx: "EstimatedStartDate", resizable: true, width: 150, halign: "center" },
{ title: "Estimated Completion Date", dataType: "date", dataIndx: "EstimatedEndDate", resizable: true, width: 175, halign: "center" },
{ title: "Date Actually Started", dateType: "date", dataIndx: "DateStarted", resizable: true, width: 150, halign: "center" },
{ title: "Date Actually Compleated", dataType: "date", dataIndx: "DateCompleated", resizable: true, width: 175, halign: "center" },
{ title: "Reason For Change", dataType: "string", dataIndx: "Reason", resizable: true, halign: "center" },
{ title: "Approval Status", dataType: "string", dataIndx: "ApprovalStatus", resizable: true, width: 105, halign: "center" },
{ title: "Approved By", dataType: "string", dataIndx: "ApprovedBy", resizable: true, width: 150, halign: "center" }
];
-
only the last column can be controlled.
scrollModel.lastColumn = "auto", "fullScroll" and "none".
http://paramquery.com/api#option-scrollModel
-
Is there anyway of dynamically sizing the rows at all or does everything have to be a fixed width?
-
Trying to do this based off of http://paramquery.com/api#option-column-width I came up with this code but it does not resize the column but the grid does get resized correctly
$(window).resize(function (evt)
{
var GridWidth = $Grid(window).width() - 10;
var ColumnModel = $Grid.pqGrid("option", "colModel");
//colModel[11].Width = GridWidth - 1459;
colModel[11].Width = 200;
$Grid.pqGrid("option", { width: GridWidth });
$Grid.pqGrid("option", "colModel", ColumnModel);
});