You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short description
There are a few issues with w2grid and loading from remote sources. First, I can't seem to get 'Load More' more to show. I've studied this example (http://w2ui.com/web/demos/#/combo/9) but there doesn't seem to be anything different than what I'm doing so not sure how to make the 'Load More' show. Second, multiple requests are made initially when the page loads. Third, I have to use preventDefault() in onLoad so that I can process the returned data or else the grid gets cleared. I don't know if the two later issues are intended behaviors but it seems off.
Here are the console.trace() during page load for the onRequest method. I don't understand why it is being triggered so many times.
Here is a reduced example based on the example cited above. I've purposely limited the number of rows just to try to get the 'Load More' link to show but it never does.
Steps to reproduce or sample
function AddRows(json) {
//...
//parse and push records
//...
w2ui['grid'].refresh();
}
let config = {
layout: {
name: 'layout',
panels: [
{ type: 'main', style: gStyle, content: 'main'}
]
},
grid: {
name: 'grid',
url: cmd,
autoLoad: false,
limit: 3,
columns: [
{ field: 'id', text: 'id', hidden:true },
{ field: 'title', text: 'Title', size: '100%' },
],
onRequest: function(event) {
//Modify the url by adding some custom parameters
event.url += mod_request;
},
onLoad: function(event) {
//Without this, the grid won't show any records.
event.preventDefault();
AddRows(event.xhr.responseText);
}
}
}
$().w2layout(config.layout);
w2ui.layout.html('main', w2ui['layout']);
$().w2grid(config.grid);
w2ui.layout.html('main', w2ui['grid']);
w2ui.grid.autoLoad = false;
w2ui.grid.skip(0);
The text was updated successfully, but these errors were encountered:
Short description
There are a few issues with w2grid and loading from remote sources. First, I can't seem to get 'Load More' more to show. I've studied this example (http://w2ui.com/web/demos/#/combo/9) but there doesn't seem to be anything different than what I'm doing so not sure how to make the 'Load More' show. Second, multiple requests are made initially when the page loads. Third, I have to use
preventDefault()
inonLoad
so that I can process the returned data or else the grid gets cleared. I don't know if the two later issues are intended behaviors but it seems off.Here are the
console.trace()
during page load for theonRequest
method. I don't understand why it is being triggered so many times.Here is a reduced example based on the example cited above. I've purposely limited the number of rows just to try to get the 'Load More' link to show but it never does.
Steps to reproduce or sample
The text was updated successfully, but these errors were encountered: