Title: Datagrid Scrollview no rows after scrolling down and reload in window
Post by: Wojak on July 01, 2024, 01:01:20 PM
Hi, I have this error that while I scroll for example, to 200 row and then use this command $('#dg').datagrid('removeFilterRule').datagrid('clearSelections').datagrid('reload');
then no rows are displayed. I have to use the button that triggers the reload of this datagrid or scroll up or down. The code for #dg $('#dg').datagrid({ url: '...', columns: [[ { field: 'opcje', title: 'Opcje', width: '50px', align: 'center', formatter: function (value, row, index) { if (row.added) { return '<a href="javascript:void(0)" onclick="a(' + row.id + ')" style="color:inherit;" title="UsuĊ"><i class="fa-solid fa-trash"></i></a>'; } return '<a href="javascript:void(0)" onclick="b(' + row.id + ')" style="color:inherit;" title="Dodaj"><i class="fa-solid fa-plus"></i></a>'; } }, { field: 'producent', title: 'Producent', width: '180px', halign: 'center' }, { field: 'nazwa', title: 'Nazwa', width: '260px', halign: 'center' }, { field: 'typ', title: 'Typ', width: '210px', halign: 'center' }, { field: 'nrKatalogowy', title: 'Nr katalogowy', width: '210px', halign: 'center' }, { field: 'opis', title: 'Opis', width: '210px', halign: 'center' }, { field: 'jmNazwa', title: 'J.m.', width: '50px', halign: 'center' }, ]], idField: 'id', rownumbers: true, singleSelect: true, pageSize: 100, remoteFilter: true, filterDelay: 1000, remoteSort: true, clientPaging: false, view: scrollview, onLoadSuccess: function () { c.forEach(el => { $(this).datagrid('updateRow', { index: $(this).datagrid('getRowIndex', el), row: { added: 1 } }); }); }, rowStyler: function (index, row) { if (row.added) { return 'background-color:lightgreen;'; } }, onSelect: function (index, row) { $(this).datagrid('unselectRow', index); }, onDblClickRow: function (index, row) { if (row.added) { a(row.id); } else { b(row.id); } }, }).datagrid('enableFilter', [{ field: 'opcje', type: 'label' }]);
I found that if I replace the command to open the window to be after reload then everything is ok
Title: Re: Datagrid Scrollview no rows after scrolling down and reload in window
Post by: Wojak on July 01, 2024, 01:11:27 PM
I found that if I replace the command to open the window to be after reload then everything is ok Never mind. It worked for a while. For no reason it stopped working again
Title: Re: Datagrid Scrollview no rows after scrolling down and reload in window
Post by: jarry on July 03, 2024, 07:05:56 PM
Please refer to this example https://www.jeasyui.com/demo/test/test20.html. It works fine.
|