Uppdatera teckensnittsinställningar från klientsidan

Contents
[ ]

Aspose.Cells GridWeb stöder nu ändring av teckensnittsinställningar från klientsidan. För detta tillhandahåller API följande funktioner

  • uppdateraCellFontStyle: Params - r/i/b/ib för vanlig/kursiv/fet/kursiv&&fet
  • uppdateraCellFontSize: Params - teckensnittsnamn, etc. ‘System’
  • uppdateraCellFontName: Params - teckenstorlek, etc. ‘12pt’
  • uppdateraCellFontColor: Params - none/u/l/ul/ for none/underline/strikout/underline&&strikout
  • uppdateraCellFontLine: Params - HTML-färg som #aa22ee eller välkänt färgnamn som grönt, rött,…
  • uppdateraCellBackGroundColor: Params - HTML-färg som #aa22ee eller välkänt färgnamn som grönt, rött,…

Följande kodavsnitt visar hur du ändrar teckensnittsinställningar från klientsidan i GridWeb.

Exempelkod

// 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>