stringify

converts a data object into a string before sending it to server

string stringify(object data);
dataobjecta data object
stringa data string

Example

var str = webix.ajax().stringify({ some: "a" });

Details

The method is called automatically before data are sent to server. If there are dates (Date objects) in the data object, they are formatted with the parseFormatStr method.

If you want to redefine the data serialization for all AJAX calls, you can redifine serialize():

webix.ajax.prototype.stringify = function(obj){ 
    // or use some custom serializer here
    return JSON.stringify(obj);
}

If you just need a method for object serialization, you may use JSON.stringify directly:

var str = JSON.stringify({ some: "a" });
Back to top