Обновите настройки шрифта со стороны клиента
Contents
[
Hide
]
В этом разделе обсуждается изменение параметров шрифта на стороне клиента в элементе управления Aspose.Cells.GridWeb.
Aspose.Cells GridWeb теперь поддерживает изменение настроек шрифта на стороне клиента. Для этого API предоставляет следующие функции
- обновлениеCellFontStyle: Params - r/i/b/ib для обычного/курсивного/жирного/курсивного и&жирного
- updateCellFontSize: Params — имя шрифта и т. д. «Система»
- updateCellFontName: Params - размер шрифта и т.д. ‘12pt’
- обновитьCellFontColor: Params - none/u/l/ul/ для none/underline/strikout/underline&&strikout
- обновлениеCellFontLine: Params - цвет html, например #aa22ee, или известное название цвета, например, зеленый, красный,…
- обновитьCellBackGroundColor: Params - цвет html, например #aa22ee, или известное название цвета, например, зеленый, красный,…
В следующем фрагменте кода показано изменение параметров шрифта на стороне клиента в GridWeb.
Образец кода
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |