i have function in JS like this handler when click will call a method custom_search in py file
_onclick_searchicon: function () {
var self = this;
var search = {};
search.Input = self.$('.text_input').val().trim();
console.log(typeof (search.Input));
rpc.query({
model: 'custom.search',
method: 'custom_search',
args: [search],
}).then(function (data) {
if (data.success === true) {
console.log(data);
self._result = data;
}
});
}
now i want to get that data and render in xml file. I try to this but it not work
<t t-name="systray_odoo_search.search_result">
QWeb.render('systray_odoo_search.search_result', {
widget: self
});
now i want to get that data and render in xml file. I try to this but it not work
<t t-name="systray_odoo_search.search_result">
<t t-set="result" t-value="widget._result"/>
<t t-if="_.isEmpty(result)">
<div class="dropdown-item-text text-center o_no_activity">
<span>No activities planned.</span>
</div>
</t>
<t t-foreach="result" t-as="record">
<div>Hello <t t-esc="record" />
</div>
</t>
</t>