Anonymous
Событие выбора Kendo MultiColumnComboBox иногда не запускается после выбора элемента
Сообщение
Anonymous » 26 ноя 2025, 11:41
У меня возникла проблема с
Kendo MultiColumnComboBox , из-за которой событие select не запускается время от времени.
Компонент : Kendo jQuery MultiColumnComboBox
Опция : serverFiltering: true
Признак : после выбора элемент, в том же или аналогичном сценарии, событие select периодически не срабатывает.
Согласно официальному отзыву Kendo, о подобной проблеме сообщалось в сопоставимой среде (см. отчет об ошибках).
Код: Выделить всё
// Minimal reproducible example for Stack Overflow
// Kendo MultiColumnComboBox: select event sometimes not firing (serverFiltering: true)
$("#productSearch").kendoMultiColumnComboBox({
dataTextField: "productName",
dataValueField: "productSku",
valuePrimitive: true,
filter: "contains",
autoBind: false,
minLength: 2,
clearButton: false,
placeholder: "품목코드 입력",
columns: [
{ field: "productSku", title: "품목코드", width: 200 },
{ field: "productName", title: "품목명", width: 220 }
],
dataSource: {
serverFiltering: true,
serverPaging: true,
serverSorting: true,
pageSize: 20,
transport: {
read: function (options) {
// --- SIMPLIFIED: extract keyword from filter ------------------------
const d = options.data || {};
let keyword = "";
if (d.filter && Array.isArray(d.filter.filters) && d.filter.filters.length) {
keyword = d.filter.filters[0].value || "";
}
if (!keyword) {
// no keyword → empty result
return options.success({ items: [], total: 0 });
}
// --- REPLACE THIS WITH YOUR REAL AJAX CALL -------------------------
// This is just a fake async call to simulate serverFiltering
setTimeout(function () {
const allItems = [
{ id: 1, productSku: "SKU001", productName: "Test Product A" },
{ id: 2, productSku: "SKU002", productName: "Test Product B" },
{ id: 3, productSku: "SKU003", productName: "Another Product C" }
];
const filtered = allItems.filter(item =>
item.productSku.includes(keyword) ||
item.productName.includes(keyword)
);
options.success({
items: filtered,
total: filtered.length
});
}, 200);
}
},
schema: {
model: { id: "id" },
data: d => d.items || [],
total: d => d.total || 0
}
},
// --- Problem: this 'select' is sometimes NOT fired -----------------------
select: function (e) {
const item = this.dataItem(e.item);
console.log("[select]", item);
// In real code, I show a 'yellow box' here based on the selected item.
},
change: function (e) {
const val = this.value();
console.log("[change]", val);
if (!val) {
// In real code, I hide the 'yellow box' and clear hidden fields.
}
}
});
Кто-нибудь знает, это известная проблема с этим виджетом или я что-то упустил в конфигурации?
Подробнее здесь:
https://stackoverflow.com/questions/798 ... tem-select
1764146499
Anonymous
У меня возникла проблема с [b]Kendo MultiColumnComboBox[/b], из-за которой событие select не запускается время от времени. [list] [*][b]Компонент[/b]: Kendo jQuery MultiColumnComboBox [*][b]Опция[/b]: serverFiltering: true [*][b]Признак[/b]: после выбора элемент, в том же или аналогичном сценарии, событие select периодически [b]не[/b] срабатывает. [/list] Согласно официальному отзыву Kendo, о подобной проблеме сообщалось в сопоставимой среде (см. отчет об ошибках). [code]// Minimal reproducible example for Stack Overflow // Kendo MultiColumnComboBox: select event sometimes not firing (serverFiltering: true) $("#productSearch").kendoMultiColumnComboBox({ dataTextField: "productName", dataValueField: "productSku", valuePrimitive: true, filter: "contains", autoBind: false, minLength: 2, clearButton: false, placeholder: "품목코드 입력", columns: [ { field: "productSku", title: "품목코드", width: 200 }, { field: "productName", title: "품목명", width: 220 } ], dataSource: { serverFiltering: true, serverPaging: true, serverSorting: true, pageSize: 20, transport: { read: function (options) { // --- SIMPLIFIED: extract keyword from filter ------------------------ const d = options.data || {}; let keyword = ""; if (d.filter && Array.isArray(d.filter.filters) && d.filter.filters.length) { keyword = d.filter.filters[0].value || ""; } if (!keyword) { // no keyword → empty result return options.success({ items: [], total: 0 }); } // --- REPLACE THIS WITH YOUR REAL AJAX CALL ------------------------- // This is just a fake async call to simulate serverFiltering setTimeout(function () { const allItems = [ { id: 1, productSku: "SKU001", productName: "Test Product A" }, { id: 2, productSku: "SKU002", productName: "Test Product B" }, { id: 3, productSku: "SKU003", productName: "Another Product C" } ]; const filtered = allItems.filter(item => item.productSku.includes(keyword) || item.productName.includes(keyword) ); options.success({ items: filtered, total: filtered.length }); }, 200); } }, schema: { model: { id: "id" }, data: d => d.items || [], total: d => d.total || 0 } }, // --- Problem: this 'select' is sometimes NOT fired ----------------------- select: function (e) { const item = this.dataItem(e.item); console.log("[select]", item); // In real code, I show a 'yellow box' here based on the selected item. }, change: function (e) { const val = this.value(); console.log("[change]", val); if (!val) { // In real code, I hide the 'yellow box' and clear hidden fields. } } }); [/code] Кто-нибудь знает, это известная проблема с этим виджетом или я что-то упустил в конфигурации? Подробнее здесь: [url]https://stackoverflow.com/questions/79830287/kendo-multicolumncombobox-select-event-sometimes-not-triggered-after-item-select[/url]