jquery - Ajax Count all hydra:totalItems -
i have make ajax counts month of submitted ticket, example, jan:4 tickets, feb:12 tickets, etc. here code:
function createdatchart(callback, createat) { $.ajax({ url: '/api', type: 'post', data: { module: 'helpdesk/tickets', method: 'get', // params: [{'createdat':createat}] params: [ { 'createdat' : { 'before': createat } } ] }, success: function (data, textstatus, jqxhr) { var data = json.parse(data); var total = data['hydra:totalitems']; console.log(total); //output 68 var d = moment(data.createdat).month();// output 8 //8 means september createat = d; console.log('total = ', total); // output = 68 if (callback) callback(d, total) } }); }
the problem is, don't know how api. access ['hydra:member'], returns 18 data object, because paging. please enlighten me. appreciated.
Comments
Post a Comment