vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.67k stars 727 forks source link

Need an option to not showing loading spinner or "load more..." while scrolling to the end of the grid #2584

Open cloudzooming opened 1 week ago

cloudzooming commented 1 week ago

first of all, thank you so much for the great library. I was using version 1.5 a lot in some projects.

I recently created a simple website to view .plist files online, which uses w2grid to show the data. Because the data are usually fixed, it does not need to load extra data while scrolling. So, I think if it's possible to

Add an option to hide the loading indicator at the end of grid for example .showLoadingIndicator = false Especially when the "autoLoad" option is false,

changes on line 7891 in w2grid.js

            more.show()
                .eq(1) // only main table
                .off('.load-more')
                .on('click.load-more', function() {
                    // show spinner
                    query(this).find('td').html('<div><div style="width: 20px; height: 20px;" class="w2ui-spinner"></div></div>')
                    // load more
                    obj.last.pull_more   = true
                    obj.last.fetch.offset += obj.limit
                    obj.request('load')
                })
                .find('td')
                .html(obj.autoLoad
                    ? '<div><div style="width: 20px; height: 20px;" class="w2ui-spinner"></div></div>'
                    : obj.showLoadingIndicator ?'<div style="padding-top: 15px">'+ w2utils.lang('Load ${count} more...', { count: obj.limit }) + '</div>' : ''
                )