Try Xenarius Free

Data Loading Options

Data loading options include sorting, filtering, grouping and selection parameters generated by the data source. Data sources send these parameters to the service to request server-side data processing. To address this request, you should take these parameters into account when building URLs and/or request arguments in order to command the server to perform the respective procedures.

Data loading options are represented by objects with the following properties:

Sort Expressions

Sort expressions can consist of:

  • Field name only. Data is sorted by this field in ascending order.

    Example:

    "lastName"
  • An object with the following structure:

    • getter - field name;
    • desc - true to sort values in descending order, false to sort them in ascending order.

    Example:

    	
    {
    	"getter": "firstName",
    	"desc": true 
    }
  • An array of the above. Sorting will be applied against all fields, from first to last.

    Example:

    	
    [
    	"lastName",
    	"firstName",
    	{ 
    		"getter": "birthdate",
    		"desc": true 
    	}
    ]
  • </ol> ## Filter Expressions A binary operator is represented by an array containing the following items. 1. Name of the field against which data items are filtered (required). 2. Comparison operator (optional). Available operators are: "**=**", "**<>**", "**>**", "**>=**", "**<**", "**<=**", "**startswith**", "**endswith**", "**contains**", "**notcontains**". The default comparison operator is "**=**". 3. The value against which the getter value is compared (required). Examples:
    	
    ["value", ">", 3]
    ["name", "contains", "st"]
    ["value", 3]
    Binary operators can be combined using "**and**" - "**or**" group operators. Examples:
    	
    [
    	[ "value", ">", 3 ],
    	"and",
    	[ "value", "<", 7 ]
    ]
    [
    	[ "value", "<", 4 ],
    	"or",
    	[ "value", ">", 6 ]
    ]
    If neighboring filter expressions are not separated by a group operator, the "**and**" operator is implied. Example:
    [
       [ "value", ">", 3 ],
       [ "value", "<", 7 ]
    ]
    You can also define operator priority by enclosing the required expression into square brackets.
    [
       ["name", "notcontains", "Second"],
       "and", 
       [
    	   [ "value", "<", 4 ],
    	   "or", 
    	   [ "value", ">", 6 ]
       ]
    ]
    ## Select Expressions A select expression represents a field name or an array of field names fetched from the data provider. Example:
    "name"
    ["firstName", "birthDate"]
    ## Group Expressions A group expression can consist of: * a field name against whose values records are grouped; * an array of field names. Records are grouped hierarchically, starting with values from the first field to those of the last field. Example:
    "city"
    ["country", "province", "city"]