Hi Harshan, What does it mean to have an attribute named "recordsTotal" in the context of using some search criteria? Shouldn't both "recordsTotal" and "recordsFiltered" overlap?
In addition, the resource URL used above does not seem to be compatible with REST-recommended standards. We'd have to create a JIRA and fix that as well. Cheers, Prabath On Fri, Apr 1, 2016 at 12:21 AM, Harshan Liyanage <hars...@wso2.com> wrote: > Hi Shavindri, > > "recordsTotal" field corresponds to the total matching records (before > filtering) in the database whereas the "recordsFiltered" corresponds to the > no of filtered records (after filtering). Ideally "recordsFiltered" value > will be different from the "recordsTotal" value if you pass a filtering > criteria (i.e. devices with username like "sha&"). But still we have not > added that support. Hence the both values will be same. But we had to > include the both params since the spec of JDataTable requires them both. > Please refer to the following doc [1] for more information. > > [1]. https://datatables.net/manual/server-side#Returned-data > > Thanks, > > Harshan Liyanage > Software Engineer > Mobile: *+94724423048* > Email: hars...@wso2.com > Blog : http://harshanliyanage.blogspot.com/ > *WSO2, Inc. :** wso2.com <http://wso2.com/>* > lean.enterprise.middleware. > > On Thu, Mar 31, 2016 at 2:04 AM, Shavindri Dissanayake <shavin...@wso2.com > > wrote: > >> Hi, >> >> When you run the REST API command to get the paginated details (example >> [1]), the output given [2] has the *recordsFiltered* and *draw* fields. >> What do they stand for? >> *(recordsFiltered* seems to give the same information as *recordsTotal)* >> >> >> [1] curl -X GET -H "Content-Type: application/json" -H "Authorization: >> Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https: >> //localhost:9443/mdm-admin/paginate/operations/ios/f409r4c55924rt4af9a44tts15y9d6cd56h1047d >> >> [2] >> > GET >> /mdm-admin/operations/paginate/ios/f409r4c55924rt4af9a44tts15y9d6cd56h1047d >> HTTP/1.1 >> > Host: localhost:9443 >> > User-Agent: curl/7.43.0 >> > Accept: */* >> > Content-Type: application/json >> > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a >> < HTTP/1.1 200 OK >> < Cache-Control: private >> < Expires: Thu, 01 Jan 1970 05:30:00 IST >> < Date: Tue, 23 Feb 2016 05:23:56 GMT >> < Content-Type: application/json >> < Content-Length: 3785 >> < Server: WSO2 Carbon Server >> {"recordsTotal":6,"recordsFiltered":6,"draw":0,"data":[ >> {"code":"DEVICE_INFO","type":"COMMAND","id":38,"status":"PENDING", >> "receivedTimeStamp":"","createdTimeStamp":"2016-02-23 10:51:22.06", >> "isEnabled":false},{"code":"APPLICATION_LIST","type":"COMMAND","id":37, >> "status":"PENDING","receivedTimeStamp":"","createdTimeStamp":"2016-02-23 >> 10:51:20.755","isEnabled":false}]} >> >> [3] JSON output. >> { "recordsTotal": 6, "recordsFiltered": 6, "draw": 0, "data": [ { "code": >> "DEVICE_INFO", "type": "COMMAND", "id": 38, "status": "PENDING", >> "receivedTimeStamp": "", "createdTimeStamp": "2016-02-23 10:51:22.06", >> "isEnabled": false } ] } >> >> >> >> Thanks & Regards >> Shavindri Dissanayake >> Technical Writer >> >> WSO2 Inc. >> lean.enterprise.middleware >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Prabath Abeysekara Technical Lead WSO2 Inc. Email: praba...@wso2.com Mobile: +94774171471
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev