ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: sbilleau on September 24, 2018, 07:20:25 pm
-
Hi all,
I've a problem with the options of my range filter.
Here the code :
filter: { type: "select",
crules: [{
condition: "range"
}] ,
valueIndx: "value",
labelIndx: "text",
options: [
{ "value": "pending", "text": "Pending" },
{ "value": "validated", "text": "Validated" },
{ "value": "unvalidated", "text": "Unvalidated" }
],
listeners: ['change']
}
The result in attachments.
Thanks
-
Yes, valueIndx, labelIndx no longer working in new filter design >= 5.2, documentation needs to be updated for this.
Please change your filter definition to this:
filter: {
crules: [{
condition: "range"
}] ,
options: [
{ "pending": "Pending" },
{ "validated": "Validated" },
{ "unvalidated": "Unvalidated" }
]
}
-
Thanks for the reply.
I've already tried several methods, including this one.
Here is the result.
-
Works fine in the examples.
Could you please share a jsfiddle so that I can check it for you.
-
Sorry for this loooooong wait: /
I can't do a JSFiddle, too expensive in time.
Here is the complete statement from my column:
{
dataIndx: 'action_plan_check_status', title: $.i18n.t("nucleys_elabel:general.nucleys_table_action_plan_check_status"), minWidth: '5%', maxWidth: '100%',
filter: {
crules: [{
condition: "range"
}],
options: [
{ "value": "pending", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_pending") },
{ "value": "validated", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_validated") },
{ "value": "unvalidated", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_unvalidated") }
]
},
render: function( ui ){
return {
text: ui.rowData.action_plan_check_status ? $.i18n.t("nucleys_elabel:general.action_plan_check_status_"+ui.rowData.action_plan_check_status) : '',
};
},
exportRender: function( ui ){
return {
text: ui.rowData.action_plan_check_status ? $.i18n.t("nucleys_elabel:general.action_plan_check_status_"+ui.rowData.action_plan_check_status) : '',
};
},
editor: {
type: 'select',
valueIndx: "value",
labelIndx: "text",
options: [
{ "value": "pending", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_pending") },
{ "value": "validated", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_validated") },
{ "value": "unvalidated", "text": $.i18n.t("nucleys_elabel:general.action_plan_check_status_unvalidated") }
]
}
}
-
I feel that it takes the base value and not the value after the render.
My need is to be able to keep the base value (to be able to make the modifications), but to filter on the values after render.
-
column.render can also be used in range filter dropdown.
Example: country flags are shown in both column cells and range filter dropdown ( ShipCountry column ) in this demo:
https://paramquery.com/pro/demos/filter_custom
selectGridObj: function(ui){
ui.obj.colModel[0].renderLabel = ui.column.render;
}
-
Thanks.
It works fine !
Now, is there a way to display, in the filter input, the rendering rather than the "true" value?
-
Checkboxes are used for true/false values.
as in paid column in https://paramquery.com/pro/demos/filter_header_local
-
To be more specific, my question is:
How, in the filter field, display the render rather than the value.
In my example, for a 'range' filter I get the render at the moment of selection, except that in the filter field, it is not the render that is displayed, but the value. (For example: 'validated' instead of 'Validé')
-
rendered values are not ( and can't be ) displayed in the range filtered field.
Please use column.format callback for that purpose as shown in this example:
https://paramquery.com/pro/demos/filter_date
API: https://paramquery.com/pro/api#option-column-format