Hi i'm using jsgrid for the company for which i work, and as in the title i have this problem.
I need to have a dropdown list with some value, and depending from this values the number of displayed object have to change. There's a way to do it? i didn't find any clue on the documentation, i could be a bad searcher, but can someone give me an help?
Hi, what is about setting option pageSize http://js-grid.com/docs/#pagesize-default-20?
$("#grid").jsGrid("option", "pageSize", 100);
is exactly what i needed! Just didn't perfectly get the documentation explanation!
thank you for the help!
You are always welcome!
This was very helpful and and its working fine when I change the page size when the drop-down value changes. But I want to change the page size after I get the response from ajax call as it will handle all possible scenarios in my case.
Can you please help me with this.
Hi, what is about setting option
pageSizehttp://js-grid.com/docs/#pagesize-default-20?$("#grid").jsGrid("option", "pageSize", 100);
excellent.
This was very helpful and and its working fine when I change the page size when the drop-down value changes. But I want to change the page size after I get the response from ajax call as it will handle all possible scenarios in my case.
Can you please help me with this.
If I get what you need correctly, you'll need to look at loadData option. Something like this:
loadData: function () {
let d = $.Deferred();
$.ajax({
url: ajax_url,
dataType: "json",
method: "METHOD"
}).done(function (response) {
// !-- set the pageSize here --!
d.resolve(response);
}).fail(function (response) {
d.reject();
});
return d.promise();
}
Most helpful comment
Hi, what is about setting option
pageSizehttp://js-grid.com/docs/#pagesize-default-20?