ExtJS-更改默认按钮样式和字体 [英] ExtJS - Changing default button styles and fonts

查看:581
本文介绍了ExtJS-更改默认按钮样式和字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个要求,我必须在Ext JS应用程序上更改默认样式.我还没有谈论更改CSS文件中的内容.我还没那么雄心勃勃.这是我在寻找的东西:

I have this requirement where I have to change the default styles on my Ext JS application. I am not talking about changing stuff in CSS files yet. I am not that ambitious yet. Here is what I am looking for:

  1. 假设我需要一个Submit和Cancel按钮,我使用xtype:button和text:Save(或Cancel).这将呈现带有文本的按钮.如果要更改按钮的外观和感觉该怎么办?还是将按钮替换为漂亮的保存"或取消"图像?

  1. Suppose I need a Submit and Cancel buttons, I use xtype:button and text:Save ( or Cancel ). This will render buttons with the text on them. What should I do if I want to change the look and feel of the button? Or replace the button with a cool Save or Cancel image?

现在,我将应用程序上的所有文本都具有ExtJS显示的默认字体.如果我想将应用程序上的所有文本更改为其他字体,该怎么办?表格/网格中的数据以及每个组件的标题中的所有内容都应更改为客户喜欢的其他字体.我该怎么办?

Right now I have all the texts on the application with the default font that ExtJS shows. What am I supposed to do if I want all the text on the application changed to a different font? Everything right from the data in forms/grids and the titles of each component should be changed to some other font my customer prefers. What am I supposed to do?

我理解这些是非常基本且通用的问题,但是在继续执行任务之前,我正在寻求一个明智的建议.

I understand these are very basic and a generic questions, but I am looking for a good headsup before I proceed with my task.

提前谢谢大家.等待答案:)

Thank you all in advance. Waiting for answers :)

更新:因此,我发现了我们如何处理CSS和更改字体.任何人都可以帮助更改提交/取消"按钮的外观.

Update: So, I found out how we deal with CSS and change the fonts. Can anyone help about the Chaning the look and feel for Submit/Cancel buttons.

推荐答案

如果您还没有准备好使用SASS进行主题化,请查看sencha文档中的按钮配置示例:

If you are not ready for theming with SASS just yet take a look at this example of button configs from the sencha docs:

Stanadalone 示例页面:

Stanadalone Example page: http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.html

CSS ,用于向按钮添加自定义图像:

CSS that adds customized images to the buttons: http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.css

JS : http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.js

基本上,这表明如何使用按钮配置上的iconCls属性以及简单的CSS类向按钮添加所需的图像.

Essentially this shows how to use iconCls property on the button config along with a simple CSS class to add desired image to your button.

这篇关于ExtJS-更改默认按钮样式和字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆