クライアント側からフォント設定を更新する

Aspose.Cells GridWebは、クライアント側からフォント設定を変更する機能をサポートしています。そのため、APIは次の関数を提供しています

  • updateCellFontStyle: パラメーター - r/i/b/ib は通常/斜体/太字/斜体&&太字
  • updateCellFontSize: パラメーター - フォント名など ‘System’
  • updateCellFontName: パラメーター - フォントサイズなど ‘12pt’
  • updateCellFontColor: パラメーター - none/u/l/ul/ はなし/下線/取り消し線/下線&&取り消し線
  • updateCellFontLine: パラメーター - #aa22eeのようなHTMLカラーや緑、赤などの一般的な色名
  • updateCellBackGroundColor: パラメーター - #aa22eeのようなHTMLカラーや緑、赤などの一般的な色名

次のコードスニペットは、GridWebのクライアント側からフォント設定を変更する方法を示しています。

サンプルコード

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
<script>
function makeFontItalic(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "i");
}
function makeFontBold(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "b");
}
function changeFontSize(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontSize, "5pt");
}
function changeFontFamily(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontName, "Corbel Light");
}
function changeFontColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontColor, "green");
}
function changeFontBackgroundColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellBackGroundColor, "yellow");
}
</script>