ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: jjestrellaa on August 08, 2017, 08:12:51 pm
-
are there any examples for getting the values for a 'SELECT' item in the toolbar from the database?
currently have this
toolbar: {
items[
{
type:'select',
options:[ { "value1": "Description1" },
{ "value2": "Description2" },
]
}
]
}
want something like this
toolbar: {
items[
{
type:'select',
options: function(){
var values = []
$.getJSON("my/url", data, function(response){
$.each(response, function(index,item){
values.push(item)
}
}
}
]
}
-
This can be closed. Just followed standard jquery:
toolbar: {
items[
{
type:'select',
options:
$.getJSON("my/url", data, function(response){
$.each(response, function(index,item){
$('.selector').append($('<option>', {
value: item.Name,
text: item.Label
}));
}
}
]
}