Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

Custom view can be used, to create your own javascript application. This application will then be executed in your view.

Warning

You need to be in edit mode in order to create new view. Click on "Edit" in top report menu to activate edit mode.


To add a new Custom view, hover over free place and click on Other view type and than Custom. The Add custom view dialog box will appear.


Image Modified


Settings

  • Name - Name of your view
  • Custom view renderer - Select your renderer, that you have add to Extentions
  • Data formula - Provide your code with config input


Custom view renderer

It's expected that this extension contains a Javascript. The name of the function can be defined using ext parameter "mainFunction" or it's generated as "main_ext_name".  So e.g. there's the ext param with value "customViewExtMain", so the JS file has main method "customViewExtMain" and that is called with 3 parameters - jQuery, container, conf.


Image Modified


Data formula

Now when you import the attached extension and define this view, you can define "Data formula" where its return value is passed to the JS in JSON format. In this case, with this extension, the data formula can be this:


Code Block
def conf = [datasetId:814]
conf.imgSrc = '/en/bi/media:showimage/5'
return conf 


Sv translation
languageja

カスタムビューは、独自のJavascriptアプリケーションを作成するために使用することができます。このアプリケーションは、ビューの中で実行されます。

Warning

新しいビューを作成するためには、編集モードである必要があります。トップレポートメニューの「編集」をクリックし、編集モードを起動します。


カスタムビューを新規に追加するには、フリープレイスにカーソルを合わせ、「その他のビュータイプ」→「カスタム」をクリックします。カスタムビューの追加]ダイアログボックスが表示されます。


Image Added


設定

  • Name - ビューの名前
  • カスタムビューレンダラ - 拡張機能で追加したレンダラーを選択します。
  • データ式 - コンフィグ入力でコードを提供します。

カスタムビューレンダラー

この拡張機能には、Javascriptが含まれていることが期待されます。関数の名前はextパラメータ "mainFunction "を使って定義するか、"main_ext_name "として生成されることがあります。 例えば、extパラメータに "customViewExtMain "という値がある場合、JSファイルには "customViewExtMain "というメインメソッドがあり、jQuery, container, confという3つのパラメータで呼ばれます。

Image Added


データ式

付属の拡張機能をインポートしてこのビューを定義すると、その戻り値がJSにJSON形式で渡される「データ式」を定義することができます。この場合、この拡張機能を使うと、データ式はこうなります:


Code Block
def conf = [datasetId:814]
conf.imgSrc = '/en/bi/media:showimage/5'
return conf