Hello,
I am new in Dhtmlx Touch, and I want to create an app which is working when offline or no internet available.
I use the dhx.proxy component, in saving data, from form and a grid…
this.orderSave = new dhx.proxy({
url: innowave.base_url + "order?r=savemobile",
storage: dhx.storage.local
});
$$('btn_save').attachEvent('onItemClick', function() {
var data = new Object();
data["detail"] = new Object()
data["detail"] = $$("detail_grid").serialize();
data["order"] = new Object();
data["order"] = $$("orderForm").getValues();
data["order"].employee = "ire05049200";
var params = ["data=" + JSON.stringify(data)]; // request parameters list
that.orderSave.post(params.join('&'), {
success: function(e) {
dhx.notice("success " + e);
},
error: function(e) {
dhx.notice("fail " + e);
}
});
});
then I tested it, when there is a connection to the server, obviously data will be save to the database, and when i turn off the connection of my mobile to the database, and send a request i will get the message “fail”, in this case i thought that the data will be save in local storage(dhx.storage.local) and will be send again if there’s a connection in the server. So, I connect the mobile again to the server, and send another request, the request is save to the database, but the request that i did while the mobile is offline are not sent to the dtabase…
can you please tell me, how does this dhx.proxy works?.. or how can i implement this?
thanks in advance!