i have problem using webix-jet and apiato (http://apiato.io/)
in apiato data response:
{
"data": [
],
"meta": {
"include": [],
"custom": [],
"pagination": {
"total": 241,
"count": 30,
"per_page": 30,
"current_page": 1,
"total_pages": 9,
"links": {
"next": "http://api.dikampus.local/v1/mahasiswa?page=2"
}
}
}
}
in webix-jet i have tried to implement custom DataDriver for read meta in apiato response.
this is my script :
export function ApiatoDriver(app) {
const service ={
init(){
webix.DataDriver.apiato = webix.extend({
getInfo: function (data) {
let size, from;
size = (data.meta && data.meta.pagination.total) ? data.meta.pagination.total : 0;
from = (data.meta && data.meta.pagination.count) ? data.meta.pagination.count : 0;
console.log(data);
return {
_size: size,
_from: from,
_parent: (data.parent || 0),
_config: (data.config),
_key: (data.webix_security)
};
}
}, webix.DataDriver.json);
}
};
app.setService("ApiatoDriver", service);
}
and in view datatable:
{view:"datatable", id:"table", editable:true, datatype:"apiato"}
but there are some that do not work, ie:
- not working serverside filter and sorting
- not working dynamicload
please help me, thanks