1. NetCommons2のファイルアップロード時にでてくるダイアログについて

投稿日時: 2016/11/14 牟田口

こんにちは。牟田口です。

ファイルアップロード時に、アップロード処理の時間が長いと
「アップロードが失敗したか、タイムアウトになった可能性があります。処理を続行しますか?」

とダイアログが出る事がありますが、
カスタマイズ時に非表示にできないか調べました。

https://github.com/netcommons/NetCommons2/blob/537e08b7a2892bacd2eed5dbac3ea45792de0f36/html/webapp/modules/common/files/js/common.js#L2451

/*timeout_flag:0の場合、タイムアウトチェックをしない     */
/*********************************************************/
sendAttachment: function(params_obj) {


上記パラメータをセットすれば、できる。

サンプルJS

 

    /**
     * ファイルアップロード
     */
    uploadFile: function() {

        var messageBody = new Object();
        messageBody["action"] = "custummodule_action_main_import";

        var option = new Object();
        option["param"] = messageBody;
        option["top_el"] = $(this.id);
        option["timeout_flag"] = 0;            // タイムアウトチェックをしない
        option["callbackfunc"] = function(response) {
            commonCls.alert("インポートしました。");
            commonCls.sendRefresh(this.id);
        }.bind(this);
        option["callbackfunc_error"] = function(file_list, res){
            commonCls.alert(res);
        }.bind(this);
        commonCls.sendAttachment(option);
    },


ではでは。