どこでもViewの基本

「どこでもView」の実体はVisualforceコンポーネントです。RaySheetの機能をコンポーネント化し、VisualforceやApex、JavaScript、CSSで利用できるインターフェースを公開しています。それらインターフェースを駆使することで開発者がRaySheetの機能を利用することができます。

ソースコードレベルで動的にRaySheetの機能を制御したい場合はApex、JavaScript、CSSを駆使する必要があります。その必要がない場合は、gcss:Spreadsheetタグに属性を設定するだけで十分です。

gcss:Spreadsheetタグの機能とその属性の詳細についてはgcss:Spreadsheetコンポーネントを参照してください。

可能な限り最小限の機能をユーザに許可するサンプルコード

VisualforceページでAllowで始まる属性を省略すると、その機能は無効化されます。たとえば、”AllowEdit”属性を省略するとレコードの保存や更新などの編集することができなくなります。次のサンプルコードでは無効化できる機能がすべて無効化されます。

フォルダモード

<apex:page showHeader="true" sidebar="false">
  <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0">
    <gcss:Spreadsheet
      ShowTitleBar="true"
      ShowToolbar="true"
      ShowFormulaBar="true"
      FolderId="ここに18桁のフォルダIDを指定します"
      ViewId="ここに18桁のビューIDを指定します"
    />
  </div>
</apex:page>

オブジェクトモード

<apex:page showHeader="true" sidebar="false">
  <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0">
    <gcss:Spreadsheet
      ShowTitleBar="true"
      ShowToolbar="true"
      ShowFormulaBar="true"
      Object="account"
      ViewId="ここに18桁のビューIDを指定します"
    />
  </div>
</apex:page>

可能な限りすべての機能をユーザに許可するサンプルコード

RaySheetの機能を有効化するには、Visualforceページで「Allow」で始まる属性の値に「true」を設定します。

フォルダモード

 <apex:page showHeader="true" sidebar="false">
  <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0">
    <gcss:Spreadsheet
      ShowTitleBar="true"
      ShowToolbar="true"
      ShowFormulaBar="true"
      FolderId="ここに18桁のフォルダIDを指定します"
      ViewId="ここに18桁のビューIDを指定します"
      AllowFormatColumn="true"
      AllowAdd="true"
      AllowEdit="true"
      AllowExport="true"
      AllowFind="true"
      AllowFreezeColumn="true"
      AllowDelete="true"
      AllowDragFill="true"
      AllowDragAndDrop="true"
      AllowMassAddNote="true"
      AllowMassAddTask="true"
      AllowObjectActions="true"
      AllowPaste="true"
      AllowPinRecords="true"
      AllowReadingPane="true" 
      AllowResize="true"
      AllowRefresh="true"
      AllowUISort="true"
      AllowUIFilter="true"
      AllowEditFavorite="true"
      AllowManageView="true"
      AllowDesignView="true"
      AllowFormulaColumn="true"
      AllowWorkingColumn="true"
      AllowSummaryRow="true"
      AllowRestrictPicklistByRecordType="true"
      AllowDetailTip="true"
      AllowQueryPanel="true"
      AllowApplySalesforceLookupFilter="true"
      AllowShowLookupSearchDialog="true"
    />
  </div>
</apex:page>

オブジェクトモード

 <apex:page showHeader="true" sidebar="false">
  <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0">
    <gcss:Spreadsheet
      ShowTitleBar="true"
      ShowToolbar="true"
      ShowFormulaBar="true"
      Object="account"
      ViewId="ここに18桁のビューIDを指定します"
      AllowFormatColumn="true"
      AllowAdd="true"
      AllowEdit="true"
      AllowExport="true"
      AllowFind="true"
      AllowFreezeColumn="true"
      AllowDelete="true"
      AllowDragFill="true"
      AllowDragAndDrop="true"
      AllowMassAddNote="true"
      AllowMassAddTask="true"
      AllowObjectActions="true"
      AllowPaste="true"
      AllowPinRecords="true"
      AllowReadingPane="true" 
      AllowResize="true"
      AllowRefresh="true"
      AllowUISort="true"
      AllowUIFilter="true"
      AllowEditFavorite="true"
      AllowManageView="true"
      AllowDesignView="true"
      AllowFormulaColumn="true"
      AllowWorkingColumn="true"
      AllowSummaryRow="true"
      AllowRestrictPicklistByRecordType="true"
      AllowDetailTip="true"
      AllowQueryPanel="true"
      AllowApplySalesforceLookupFilter="true"
      AllowShowLookupSearchDialog="true"
    />
  </div>
</apex:page>

“FolderId”属性と”ViewId”属性に指定する18桁のIDの値の取得方法についてはビュー情報フォルダのプロパティを参照してください。

オブジェクトモードの場合のサンプルコードは取引先オブジェクト(API名はaccount)を例としています。

Copyright © 2024 MESCIUS inc. All rights reserved.