Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4798 Lượt xem

Hello,


When a tree view is displayed the default number of row is 4.

So the tbody contains 4 <tr>.

I want only one row to be displayed, any idea how can I do it please ?

I tried to put limit=1 in my xml but it didn't work and I didn't succeed to find an answer on internet.


Thanks

Ảnh đại diện
Huỷ bỏ

Your question is not understandable. Please provide more information.

Tác giả Câu trả lời hay nhất

Ok king, my question is understable, but now my answer will be more understable.

If you want to remove some of the defaults rows you can do it with css :

#history .oe_list_content > tbody tr:nth-child(2), #history .oe_list_content > tbody tr:nth-child(3), #history .oe_list_content > tbody tr:nth-child(4) {
display: none;
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Ok king
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, 

I have tried the same method by adding the limit but there is no affect.

So used to overwrite the ListRenderer JS code please refer the below code. By changing the while condition from 4 to 1 this will reduce

this will affect in every default tree view so please be aware of that

var ListRenderer = require('web.ListRenderer');


var ListRenderer = require('web.ListRenderer');


ListRenderer.include({  _renderBody: function() {  var self = this;  var $rows = this._renderRows();  while ($rows.length ').append($rows);  },


});



NB: The question was raised 2 years before if this is useful for anyone else

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 15
4281
3
thg 3 15
17767
2
thg 11 22
7169
Table treeview Đã xử lý
3
thg 10 18
5371
2
thg 12 21
5121