モーダルボックスの処理

モーダルボックスの処理

お知らせ:当社は、お客様により充実したサポート情報を迅速に提供するため、本ページのコンテンツは機械翻訳を用いて日本語に翻訳しています。正確かつ最新のサポート情報をご覧いただくには、本内容の英語版を参照してください。

invokeメソッドによるモーダルボックスの表示

指定した場所に拡張機能の新しいiframeインスタンスを作成します。

zohobugtracker.invoke('modal.create',modal_location);

引数名 データ型 説明
action 文字列 'modal.create' - モーダルボックスを作成または開きます。
modal_location オブジェクト 呼び出すHTMLファイルの相対パスです。例:{'url':'/app/choosefiles.html'};

ウィジェットIDと文字列定数が出力として生成されます。

invokeメソッドによるモーダルボックスの終了

指定した場所ですでに開かれている拡張機能のiframeインスタンスを閉じます。

zohobugtracker.invoke('modal.close',modalInfo.widgetID);

引数名 データ型 説明
action 文字列 'modal.close' - 開いているモーダルボックスを閉じます。
widgetID オブジェクト 'modal.create'の出力として生成されたwidgetIDをこちらに渡す必要があります。

invokeメソッドによるモーダルボックスのサイズ変更

拡張機能のiframeインスタンスを指定したサイズに変更します。

zohobugtracker.invoke('modal.resize', resize_modal);

引数名 データ型 説明
action 文字列 'modal.resize' - モーダルボックスの初期サイズを拡大します。
resize_modal オブジェクト 呼び出すHTMLファイルの相対パスです。例:{'width': 600, 'height': 400};
許容される高さの最小値と最大値:380px、450px。
許容される幅の最小値と最大値:550px、850px。

ウィジェットIDと文字列定数が出力として生成されます。

invokeメソッドによる通知の表示

指定した場所に拡張機能に関連する通知を表示します。現在はバグタブでのみサポートされています。

zohobugtracker.invoke('showNotification', notification_details);

引数名 データ型 説明
action 文字列 'showNotification'
notification_details オブジェクト

例:{notificationData:'5'}

このキーに対応付けられた値が通知として表示されます。

 

invokeメソッドによる添付ファイルピッカーの終了

ファイルを添付するために指定した場所で開かれた拡張機能のiframeインスタンスを閉じます。

zohobugtracker.invoke('attachment_picker.close');

instance

特定のウィジェットのインスタンスを作成します。

zohobugtracker.instance(widget_ID);

引数名 データ型 説明
ID 文字列 invokeメソッドから生成されたウィジェットIDです。

emit

現在の場所からデータを送信します。

zohobugtracker.emit('KeyforMyListener', data);

on

emitメソッドからのデータを待ち受ける、または受信します。

zohobugtracker.on('KeyforMyListener', data);

以下のサンプルコードブロックが親ファイル '/apps/index.html' から呼び出され、'/apps/file.html' が子ファイルであるとします。
var modal_location={'url':'/apps/file.html'};
zohobugtracker.invoke('modal.create',modal_location).then(function(modalInfo){
var modalInstance=zohobugtracker.instance(modalInfo.widgetID);
modalInstance.on('modal.opened', function(){ /* This code listens for the status 'modal.opened' from the child HTML - file.html */
var data = {org: '1234'};
modalInstance.emit('submit', data);
});/* This code throws a status 'submit' along with an object to the child HTML - file.html*/
modalInstance.on('submitted',function(data){ 
/*This code listens for a status with the key 'submitted' from the child HTML*/
zohobugtracker.invoke('modal.close', modalInfo.widgetID);
});

以下のサンプルコードブロックが子ファイル「/apps/file.html」から呼び出され、「/apps/index.html」が親ファイルであるとします。

var filedetails = {'filename': 'abc'};
zohobugtracker.on('submit', function (data) {});
/*This code listens for an event with the key 'submit' from the parent file index.html  */
zohobugtracker.emit('submitted', filedetails); 
/* This code throws a status 'submitted' along with an object to the parent file index.html */

アラート

成功または失敗のアラートを設定して表示します。

zohobugtracker.invoke('alert', {
                            type: 'success',  //or 'failure'
                            data: 'Permission granted successfully'
                        });