w2utils.settings

Global settings for w2ui
Object
There is a number of default settings used across w2ui library (grid, form, tooltip, toolbar, etc). The setting object is a map with the following structure: You can define and load settings based on your locale. See .locale() method for more information. All locale specific files are located in /src/locale folder.

Data Types

w2utils.settings.dataType can be one of the following.
JSON (default) - will encode params as a JSON string and will submit GET request for most of the actions in grid, forms, remote drop down, except for the form save, which will be submitted as POST. The body of the POST request will be encoded as JSON. For w2grid the GET request will look like this:
HTTP - will encode params as HTTP string and will submit GET request, except form save, that will be submitted as POST. The body of the POST request will be encoded as JSON. For the grid the GET request will look like this:
RESTFULL - will encode params as HTTP string and will submit GET for list, PUT for save, DELETE for delete, POST for update actions in w2grid and w2forms. The body of the POST, PUT, DELETE requests will be encoded as JSON. You can use RESTFULLJSON to encode GET requests with JSON. For w2grid the GET request will look like this:
dataType can also be a JavaScript function. If it is a function, it will receive (url, fetchOptions, options) as arguments and it must return fetchOptions. This fetchOptions will be used in the browser fetch() call. This way you can fully customize how the request will be sent to the server.

User Comments

comments powered by Disqus