ux saveAll

Description

Send data to the backend and block the app in the meanwhile. It switch the "Save" button to "Saving" also.

Parameters

string

URL

object

JSON object with the parameters to send

function

Callback function to execute after the command receives a reply.

object

JSON object with the options:

contentType

json|multipart|standard

timeout

Max time to wait a reply

loading

Block the app while sending/receiving data. Default: true

Return

void


Example


ux.saveAll( '/odata4/v1/issue?$ProgramId='+appInfo.gid+'&$AppId='+appInfo.appID
        , json_with_all_data_to_send
        , function(err, result) {
            if ( !err /* && result hasn't errors */ ) {
                    ux.dialog(_t("Data saved!"),msg, { buttons:[{id:'ok', title:_t("Ok"),type:"is-success"}] }
                                , function(){
                                        // Reset here the app
                                }.bind(this)
                            );
            } else {
                ux.dialog(_t("Error"),_t("An unknown error happened. Please wait some seconds and try again."), { buttons:[{id:'ok', title:_t("Ok"),type:"is-danger"}] } );
                ux.loading(false);
            }
          }.bind(this)
        , {contentType:'json',timeout:180000}
    );

No Preview available