Browse Source

Jul 15 : [UPDT] Updated 'custom_list_view'

pull/266/head
AjmalCybro 2 years ago
parent
commit
ad6b5107c3
  1. 11
      custom_list_view/static/src/js/record_highlight.js
  2. 5
      custom_list_view/static/src/xml/record_highlight.xml

11
custom_list_view/static/src/js/record_highlight.js

@ -10,9 +10,14 @@ patch(ListRenderer.prototype, 'custom_list_view/static/src/js/record_highlight.j
setup(){ setup(){
this._super(...arguments) this._super(...arguments)
onMounted(() => { onMounted(() => {
var list = $('.o_section_and_note_list_view thead').find('tr') var tdElement = document.createElement('td');
var elem ='<th style="min-width: 33px; width: 67px;">Sl No</th>' var thElement = document.createElement('th');
list.prepend(elem) thElement.innerText = "Sl No"
thElement.style.width = "60px"
var firstRow = $(this.__owl__.bdom.parentEl.querySelectorAll('.o_list_table')).find('thead tr').first();
var secondRow = $(this.__owl__.bdom.parentEl.querySelectorAll('.o_list_footer')).find('tr').first();
firstRow.prepend(thElement);
secondRow.prepend(tdElement);
}); });
}, },

5
custom_list_view/static/src/xml/record_highlight.xml

@ -1,9 +1,4 @@
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-name="custom_list_view.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension" owl="1">
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
<th>Sl No</th>
</xpath>
</t>
<t t-name="custom_list_view.add_number" t-inherit="web.ListRenderer.Rows" t-inherit-mode="extension" owl="1"> <t t-name="custom_list_view.add_number" t-inherit="web.ListRenderer.Rows" t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-foreach='list.records']" position="before"> <xpath expr="//t[@t-foreach='list.records']" position="before">
<t t-set="RowNumber" t-value="1" /> <t t-set="RowNumber" t-value="1" />

Loading…
Cancel
Save