I write this function to fill a combobox with datagrid content in OnLoadSuccess() event :
var rows = $(dd).datagrid('getData');
$.each(filters, function (num_filter, filter) {
if (filter.type == 'combobox') {
var menu = [{ value: '', text: 'All' }];
var found;
$.each(rows.rows, function (num_data, row) {
found = false;
$.each(menu, function (num_menu, item_menu) {
if (item_menu.text == row[filter.field]) {
found = true;
return false;
}
});
if (found == false) {
menu.push({ value: row[filter.field], text: row[filter.field] });
}
});
var cc = $(dd).datagrid('getFilterComponent',filter.field);
if (cc != undefined) {
cc.combobox('loadData', menu);
}
}
});
My problem is the getData method return filtered datas, then the first time i open combobox all is right, but the second time (after filering) only 'All' and my selection appears in the combobox!
is-it possible to get all datas (filtered and not filtered) to correctly fill my combobox?