作成日: 2017/04/14 最終更新日: 2017/04/14
文書種別
使用方法
詳細
スクリプトメンバのGetSelectedRange メソッドにて、選択範囲を取得することができます。
【JavaScript サンプルコード】
【JavaScript サンプルコード】
<script type="text/javascript">
function btclick()
{
var spread = document.getElementById("FpSpread1");
var rg = spread.GetSelectedRange();
if(rg.type == "Table")
{
alert("シート全体が選択されています");
}
else if(rg.type == "Row")
{
alert(String(rg.row + 1) + "行目から" + String(rg.rowCount) + "行選択されています");
}
else if(rg.type == "Column")
{
alert(String(rg.col + 1) + "列目から" + String(rg.colCount) + "列選択されています");
}
else if(rg.type == "Cell")
{
alert("Cell(" + String(rg.row) + ", " + String(rg.col) + ")~Cell(" + String(rg.row + rg.rowCount - 1) + ", " + String(rg.col + rg.colCount - 1) + ")が選択されています");
}
}
</script>
function btclick()
{
var spread = document.getElementById("FpSpread1");
var rg = spread.GetSelectedRange();
if(rg.type == "Table")
{
alert("シート全体が選択されています");
}
else if(rg.type == "Row")
{
alert(String(rg.row + 1) + "行目から" + String(rg.rowCount) + "行選択されています");
}
else if(rg.type == "Column")
{
alert(String(rg.col + 1) + "列目から" + String(rg.colCount) + "列選択されています");
}
else if(rg.type == "Cell")
{
alert("Cell(" + String(rg.row) + ", " + String(rg.col) + ")~Cell(" + String(rg.row + rg.rowCount - 1) + ", " + String(rg.col + rg.colCount - 1) + ")が選択されています");
}
}
</script>
旧文書番号
40292