Sort query with javascript

231 views
Skip to first unread message

serc...@gmail.com

unread,
Nov 4, 2013, 12:38:33 PM11/4/13
to suppor...@runmyprocess.com
Hi,


Try performing the following query with javascript to get the sorted data but the data are not in the order listed.

var pattern = {};
pattern.id_guardia = "GUA-1383583267122";
pattern.puesto = "CJD";
pattern.parque = "azuqueca";

var options = {};
options.orderby = ["index", "set"];
options.order = ["desc", "asc"];
options.asynchronous = false;

col_trabajadores.listCallback (pattern, options, ok, {});

ok function (result) {alert (JSON.stringify (result))}

Where can be the error?

Attach the results of the query.

Regards.

result.png

Sabine El Rassy

unread,
Nov 4, 2013, 1:06:41 PM11/4/13
to RunMyProcess Support Forum
Hello Sergio,

Are you sure you have the field "set" in your collection? options.orderby = ["index", "set"];
If not try to use this code instead

var options = {};
options.orderby = "index";
options.order = "desc";
options.asynchronous = false;

Best regards,

Sabine EL RASSY 
Reply all
Reply to author
Forward
0 new messages