General Category > Help for ParamQuery Pro
Filter header box
paramvir:
yes it would be easier if converted into this format:
--- Code: --- { "1": "January" },
{ "2": "Febuary" }
--- End code ---
rebound.support:
Hi,
Can you guide me to how to bind filter options dynamic?
Following code I have added but not working.
create: function (evt, ui) {
$.getJSON("Common.ashx?Action=MonthNew", function (response) {
var column = grid.getColumn({ dataIndx: 'MonthName' });
column.filter.options = response;
});
},
paramvir:
your code looks fine. Please try to debug your code.
Do you get any error in the console.
What's the value of response?
rebound.support:
Hi,
Code:
================
For DropDown:
{
title: "Month", dataIndx: "MonthName", width: 110, valueIndx: "Month", align: "center",
filter: {
crules: [{ condition: 'range' }],
options: [
],
},
editor: {
type: 'select',
valueIndx: "ID",
labelIndx: "Name",
mapIndices: { "Name": "MonthName", "ID": "Month" },
options: [
]
},
validations: [{ type: 'minLen', value: 1, msg: "Required" }]
},
========================
For Filling data to filter:
create: function (evt, ui) {
$.getJSON("Common.ashx?Action=MonthNew", function (response) {
var column = grid.getColumn({ dataIndx: 'MonthName' });
column.filter.options = response;
});
},
===================
Response from Handler is:
{1:"January"},{2:"February"},{3:"March"},{4:"April"},{5:"May"},{6:"June"},{7:"July"},{8:"August"},{9:"September"},{10:"October"},{11:"November"},{12:"December"}
==============================
Value in Filter dropdown:
No row to display.
==================================
Console Error:
No Error.
paramvir:
response is supposed to be an array.
Checked your code, it works fine: https://stackblitz.com/edit/paramquery-demo-filter-dropdown?file=index.js
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version