-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filtering vs loadData #524
Comments
I suppose it's the correct behaviour: when you load your data from a remote source, it's supposed to be paginated and filtered server side. Have a look in the documentation for the loadData parameters the filter object contains all the information you need to pass server side to filter your data |
It is not really what i want to do. I understand more how it works. loadData provides a data set. Enter press key resubmit the loadData. It could be usefull to put a prevent submit jquery command. |
Because the demo works on local data. I think you could do something defining your own load strategy http://js-grid.com/docs/#load-strategies but I'm not really sure about it. In my opinion, it doesn't make sense to get the data by ajax and then pretend to sort and filter locally. If you need just one call to get the data, you don't need ajax at all. You can simply put your data in the page. |
Well i succeed to make it works. I was using slickgrid up to now and i feel something is missing here. |
@nono1974, the actual filtering should be implemented by your code. In the demos it's implemented in function applyFilter(data, filter) {
return $.grep(data, function(item) {
// return true/false depending on filter condition
return (!filter.Name || item.Name.indexOf(filter.Name) > -1)
});
};
// grid config
controller: {
loadData: (function() {
var data;
return function(filter) {
if(data)
return applyFilter(data, filter);
return $.ajax({ /* request params */ }).then(function(result) {
data = result;
return applyFilter(data, filter);
});
};
}())
}, Please, checkout the following issue #32 |
Hi It is exactly what i did thank you. regards Arnaud |
Hi,
I am dynamically rendering the grid with an ajax call that is working fine.
I am nevertheless getting challenge to make the filter working.
when I enter some letters I need to press enter but the enter pressing call again the loadData.
could you help me please ?
The text was updated successfully, but these errors were encountered: