Обновление настроек шрифта с клиентской стороны
Contents
[
Hide
]
В этой теме обсуждается изменение настроек шрифта с клиентской стороны в элементе управления Aspose.Cells.GridWeb.
Aspose.Cells GridWeb теперь поддерживает изменение настроек шрифта с клиентской стороны. Для этого API предоставляет следующие функции
- updateCellFontStyle: Параметры - r/i/b/ib для обычного/курсивного/жирного/курсивного&&жирного
- updateCellFontSize: Параметры - название шрифта и т. д. ‘Системный’
- updateCellFontName: Параметры - размер шрифта и т. д. ‘12pt’
- updateCellFontColor: Параметры - none/u/l/ul/ для none/подчеркнутый/зачеркнутый/подчеркнутый&&зачеркнутый
- updateCellFontLine: Параметры - html-цвет как #aa22ee или известное имя цвета, например зеленый, красный, …
- updateCellBackGroundColor: Параметры - 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> |