Skip to Content
Menu
This question has been flagged
2153 Views

Can i use QWeb.render in javascript to replace a <div>

example


this._$homeMenu = this.$('.o_home_menu');

_onKeydown_searchText: function () {
var self = this;
self._$homeMenu.html(
    QWeb.render('systray_odoo_search.search_result', {
        widget: self
    }));
},

in xml file

<t t-name="systray_odoo_search.search_result">
    <t t-set="result" t-value="widget._result"/>
    <t t-if="result.success == false">
      <div>No result planned.<t t-esc="record" />
      </div>
    </t>
    <div id='content'>
      <t t-foreach="result.data" t-as="record">
        <div class="all test">
          <t t-esc="record" />
        </div>
      </t>
    </div>
  </t>
Avatar
Discard
Related Posts Replies Views Activity
2
Apr 23
6964
3
Sep 20
3269
2
Apr 20
4831
0
Aug 24
317
1
Dec 23
939