Library Reference
...
JS Library
Events
Events callback
2min
Below are some useful callback examples.
See : Events for more detals on syntax and options
JS
klevu.coreEvent.attach("setRemoteConfigQuickOverride", {
name: "attachRemoteConfigQuickOverride",
fire: function () {
klevu.each(
klevu.search.extraSearchBox, function (key, box) {
box.getScope().chains.events.focus.add({
name: "customFocusEvent",
fire: function (data, scope) {
console.log("[EVENT] Quick Search on focus event");
}
});
box.getScope().chains.events.keyUp.add({
name: "customKeyUpEvent",
fire: function (data, scope) {
console.log("[EVENT] Quick Search on keyup event");
}
});
box.getScope().chains.request.send.add({
name: "customSendEvent",
fire: function (data, scope) {
console.log("[EVENT] Quick Search send search request");
}
});
box.getScope().chains.template.render.add({
name: "customRenderEvent",
fire: function (data, scope) {
console.log("[EVENT] Quick Search results rendering")
}
});
box.getScope().chains.template.events.add({
name: "customAfterRenderEvent",
fire: function (data, scope) {
console.log("[EVENT] Quick Search results rendered")
}
});
}
);
}
});
JS
klevu.search.landing.getScope().chains.template.events.add({
name: "renderResponseCustom",
fire: function(data, scope) {
console.log("Klevu Template rendered");
}
});
.