You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -116,7 +117,7 @@ Trigger a request to the function import OData service that was specified in the
116
117
Removes all operations in the current batch.
117
118
118
119
119
-
### create(sPath, oData, mParmeters?)
120
+
### create(sPath, oData, mparameters?)
120
121
Trigger a POST request to the CRUD service that was specified in the model constructor. Please note that deep creates are not supported and may not work.
121
122
122
123
**Parameters:**
@@ -163,6 +164,67 @@ Type | Variable | Description
163
164
*{string}* | **sPath** | Name of the path to the collection.
164
165
*{object}* | **oData** | An object that specifies a set of properties or the entry
165
166
167
+
### exportToCSV(sPath, oData, mparameters?)
168
+
Export the data to a CSV file.
169
+
170
+
**Parameters:**
171
+
172
+
Type | Variable | Description
173
+
--- | --- | ---
174
+
*{string}* | **sPath** | A string containing the path to the collection where an entry should be created. The path is concatenated to the sServiceUrl which was specified in the model constructor.
175
+
*{object}* | **oData** | Data of the entry that should be created.
176
+
*{map}* | **mParameters?** | Optional parameter map containing any of the following properties:
177
+
*{function}* | **mParameters.success?** | A callback function which is called when the data has been successfully retrieved. The handler can have the following parameters: oData and response.created.
178
+
*{function}* | **mParameters.error?** | A callback function which is called when the request failed. The handler can have the parameter oError which contains additional error information.
179
+
*{array}* | **mParameters.excludeColumns?** | Array of columns which should be excluded in the CVS export, default false (no columns will be excluded)
180
+
*{string}* | **mParameters.filename?** | Filename for the CSV file. If not set, the filename is generated by combining the sPath + the current timestamp
181
+
*{function}* | **mParameters.formatValue?** | A callback function which is called when each value is parsed. return the value you want to show in the CSV row.* The handler has the following parameters (string) sColumn and (mixed) value (*see example below)
182
+
*{function}* | **mParameters.formatColumnName?** | A callback function which is called on creating the CSV header columns. return the columnname you would like tho show in the first csv row.* The handler has the following parameter (string) sName. (*see example below)
183
+
*{array}* | **mParameters.includeColumns?** | Array of columns which should only be included in the CSV export, default false (all columns will be included)
184
+
*{boolean}* | **mParameters.refreshData?** | If set to True, a fresh set of data will be requested. If set to false, the current model data would be used (if there is no data available a new request will be fired towards the api), default false
Get the table primary key. If there is no primary key set in the db, it will return the default primary key which is 'id', the default primaryKey can be changed by setPrimaryKey(); or by passing primaryKey in the class constructor
0 commit comments