filtering vs loadData
See original GitHub issueHi,
I am dynamically rendering the grid with an ajax call that is working fine. I am nevertheless getting challenge to make the filter working.
var urlField = function(config) {
jsGrid.Field.call(this, config);
};
urlField.prototype = new jsGrid.Field({
css: "url-field", // redefine general property 'css'
align: "center", // redefine general property 'align'
myCustomProperty: "foo", // custom property
sorter: function(url1, url2) {
return url1 - url2;
},
itemTemplate: function(value) {
return "<a href='/abonnes/"+value+"' class='uk-icon-download uk-icon-button'></a>";
}
});
jsGrid.fields.url = urlField;
$("#jsGrid").jsGrid({
height: "auto",
width: "100%",
filtering:true,
sorting: true,
paging: true,
autoload: true,
inserting: false,
editing: false,
pageSize: 15,
pageButtonCount: 5,
controller: {
loadData: function() {
var d = $.Deferred();
$.ajax({
type: "GET",
url: "/index.php?option=com_directory&view=fichiers&type="+type+"&format=raw",
dataType: "json",
success:function(response){
d.resolve(response);
}
});
return d.promise();
}
},
fields: [
{ name: "Id", title:"#", type: "number", width: 20, filtering: true },
{ name: "Titre", title:"Titre", type: "text", width: 250, filtering: true },
{ name: "Action", title:"", type: "url", width:40}
]
});
when I enter some letters I need to press enter but the enter pressing call again the loadData. could you help me please ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Loading js-grid then filtering data - Stack Overflow
Server-side filtering is done by a server script that receives filtering parameters, and uses them to retrieve data. Here is how your controller.loadData...
Read more >LoadData, sort and filter? - Radzen IDE (Blazor server-side)
I've looked at the LoadData example but I don't get what I need to do to be able to filter or sort on...
Read more >Filter LoadData | Collections Filter - Power Platform Community
I am trying to copy the data from local cache to collection test91. In this i want to bring the data which is...
Read more >loadData() breaks column filters - Issues - Handsontable Forum
After applying column filters and loading new data via loadData(), the filter menu behaves weirdly.
Read more >Documentation - jsGrid
loadData is a function returning an array of data or jQuery promise that will ... When pageLoading is true the loadData method of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nono1974, the actual filtering should be implemented by your code. In the demos it’s implemented in
db.js
. The filter is coming inloadData
as the first parameter. So you have to apply it on your dataset. If you don’t want to reload data from the server you could do it in loadData caching the result. In my example I use self-evaluating function, but you can cache data anywhere:Please, checkout the following issue https://github.com/tabalinas/jsgrid/issues/32
Hi
It is exactly what i did thank you.
regards
Arnaud