明示的なキャンバスアプリケーションのサイズ変更
次のコード例に、resize メソッドをコールしてキャンバスアプリケーションのサイズを変更する方法を示します。高さと幅のパラメーターを指定しない場合、親ウィンドウはキャンバスアプリケーションの高さをそのコンテンツに基づいて判断しようと試み、その結果に応じて iFrame の幅と高さを設定します。
1// Automatically determine the size.
2Sfdc.canvas(function() {
3 sr = JSON.parse('<%=signedRequestJson%>');
4 Sfdc.canvas.client.resize(sr.client);
5});
6
7// Set the height and width explicitly.
8Sfdc.canvas(function() {
9 sr = JSON.parse('<%=signedRequestJson%>');
10 Sfdc.canvas.client.resize(sr.client, {height : "1000px", width : "900px"});
11});
12
13// Set only the height.
14Sfdc.canvas(function() {
15 sr = JSON.parse('<%=signedRequestJson%>');
16 Sfdc.canvas.client.resize(sr.client, {height : "1000px"});
17});