0

ユーザーが一部のページで 1 つのファイルのみをアップロードし、他のページでは複数のファイルをアップロードできるようにしたいと考えています。この番号を変更する場所があります

var parentWidget = ($.blueimpFP || $.blueimp).fileupload;
$.widget('blueimpUI.fileupload', parentWidget, {
    options: {
        // By default, files added to the widget are uploaded as soon
        // as the user clicks on the start buttons. To enable automatic
        // uploads, set the following option to true:
        autoUpload: false,
        // The following option limits the number of files that are
        // allowed to be uploaded using this widget:
        maxNumberOfFiles: undefined,

しかし、ここで変更すると、Web サイト上のすべての jQuery Upload File コントロールに適用されます。オプション maxNumberOfFiles をカスタマイズして目的を達成するにはどうすればよいですか。

4

1 に答える 1

0

各ページのオプションで値を定義することはできませんか?

ページ1

{ maxNumberOfFiles: 5}

ページ2

{ maxNumberOfFiles: 1}

または、引数として必要なファイルの数を渡す独自の関数でラップしますか?

編集:OK - 私がこれを投稿してから質問を少し変更しましたが、同じことが当てはまります

于 2012-06-27T11:11:01.147 に答える