グラフの表示後イベント
グラフを表示した後に発生するイベントです。
- PC用とスマートフォン用で利用できます。
- スペースに貼りつけたアプリでは利用できません。
- モバイル非対応グラフ(クロス集計・表・定期レポート)を表示するときにも発生します。
- kintone.Promiseオブジェクトをreturnすると、非同期処理の完了を待って次の処理を開始します。
イベントタイプ
環境 | イベントタイプ |
---|---|
PC用 | app.report.show |
スマートフォン用 | mobile.app.report.show |
eventオブジェクトのプロパティ
プロパティ名 | 型 | 説明 |
---|---|---|
appId | 数値 | アプリID |
type | 文字列 | イベントタイプ |
eventオブジェクトで実行できる操作
非同期処理の完了を待って次の処理を行う
kintone.Promise オブジェクトを return することにより、非同期処理の完了を待ってからeventオブジェクトで実行できる操作を実行できます。
同じイベントに複数のイベントハンドラが登録されているとき、エラーなどが発生してThenableオブジェクトが棄却された場合には、後続のイベントハンドラの処理は実行されません。
記述方法は kintone における Promise の書き方の基本を参考にしてください。
サンプル
グラフ表示時にメッセージを表示します。
I would like to access the query that graph used to filter the records in order to display the chart, how could i do it?
Eg: to show total record for a specific chart, hence i have to send a request with query param to kintone API to get records, but i can not get the exact query for the graph like kintone.app.getQuery () at index page.
Editted: i found that the groups param on chart page url is related to the field used to devide records to categories. but i dont know how to get that id? something 's similar to "groups=f20690"
Hi Nguyễn Hiệp
We are sorry to say, there is no easy way of getting the data that you need.
The kintone.app.getQuery () method will let you get the filter conditions used in the Graph, but it will not show the "Group by" options that you would need.
You are correct in saying that the "groups=fxxxx" parameter is where that information lies. You could use a native JavaScript object window.location.href to get the current URL which would include the "groups=fxxxx" information.
But I'm afraid this will not help you much, since the IDs of the fields used here cannot be retrieved by our REST APIs, and can only be obtained by checking the DOM of the fields.
We will let the kintone dev team know of the issue though, as this Graph Event could do better by returning back more information than just the appId.
If you have any other suggestions for any more properties that could be returned for this event (other than field information and query information) , please let us know.
Though,i 'll try to manually get the IDs now, i hope the event could provide more information soon
Anyway, thank you for your sincere support.