ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: joaosales on January 12, 2018, 06:32:00 pm
-
Hi, I have a grid that shows data for some items during the a year and a text field and 2 buttons to change the years like the attachment.
When i either click one of the buttons or type the year it will refresh the table data and columns to reflect the chosen year.
But the way i'm doing it it is updating the colModel, but the columns are not being updated and so the groupheader of the grid still showing the year that is loaded, am i missing something?
Here is the code for the table update of the colModel, the buildColumnModel method only creates a new array setting a new parent named after the new year and the 12 columns for each month.
var $filterText = this.toolbar().find(".filterValue"),
oldVal = Number($filterText.val());
$filterText.val(--oldVal);
let date = new moment().year(oldVal);
date = date.startOf('year');
this.colModel = buildColumnModel(date, true);
this.option( 'colModel', grid.option( 'colModel') );
this.refresh();
Thanks,
-
you can't assign colModel to grid like this.
this.colModel = buildColumnModel(date, true); it is incorrect.
Assuming you want to update whole colModel with buildColumnModel(date, true)
this.refreshCM( buildColumnModel(date, true) );
this.refresh();
-
Hi, im with a problem related to what i was doing here
I fixed to use the refreshCM and it worked like planned. But I have now a checkbox column mapped to true/false values
{
title: "Total",
dataIndx: "sumRow",
type: 'checkbox', //required property.
}
and every time i use the buttons that refresh the colModel the column stops being a checkbox and only show true and false values.
-
Checkbox column can't be added or removed dynamically, it should be predefined in the initial colModel.
It can only be hidden/ made visible after initialization.
If you are still facing issues, please share a jsfiddle/ plnkr.
-
Is the above issue fixed or it is still an open issue in PQ grid, We are having a similar requirement like this
-
Checkbox column can be added or removed dynamically in recent version.