使用jquery小部件自定义Grid的颜色 [英] customize colors of Grid implemented using jquery widgets

查看:80
本文介绍了使用jquery小部件自定义Grid的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用jquery实现我的网格,支持jquery小部件。

现在我想自定义我的网格颜色。程序是什么?

我对批量代码感到困惑。



感谢。

Hi,

I implemented my grid using jquery with support of jquery widgetes.
Now i wanted customize my grid colors. What is the procedure?.
I am getting confusion with bulk code.

Thanku.

推荐答案

关于你的问题,可以有两种方法在jQuery小部件中实现样式更改。



1.每个网格都使用表格呈现元素作为基础。因此,有一种方法可以只识别网格的id和与之关联的表结构。并且,在识别行和列后,根据这些表元素添加css。



2.如果通过div元素中的自定义生成网格,则始终存在与jquery小部件的每个组件关联的类。因此,无论在网格中呈现什么,每个coloum,行和数据都必须与一个类关联。



您可以通过观察生成的源来识别那些被归类的页面使用firebug或任何其他工具,或只是通过浏览器查看源。并且他们根据这些类编写css。

如果有jQuery小部件的css文件,你也可以检查并对css进行一些更改。





我感觉和通常遵循的更好的方式是

1.检查firebug中的渲染元素,并检查哪个类与之关联元素通过小​​部件。

2.如果小部件存在css文件,找到为该类定义的样式并为该类添加一些样式。

3.如果该窗口小部件不存在任何css文件,只需添加一个具有相同名称的类,并将自定义样式添加到页面或该页面的引用样式表中。



我希望这会有所帮助。

谢谢
There can be two ways to implement style changes in jQuery widgets, with respect to your problem.

1. Every grid is rendered using table elements as a base. So, one ways can be just identify the id of your grid and the table structure associated with it. And, add your css based on those table element after identifying your rows and columns.

2. If in case grid is generated through customization in div elements, there is always a class associated with each component of a jquery widget. So, whatever is rendered in your grid, each coloum, row and data must have been associated with a class.

You can identify those classed through observing generated source of your page either useing firebug or any other tool, or simply by viewing source through browser. And them write the css based on those classes.
And, if there is css file with the jQuery widget you can also check and and make some changes to css.


The better way I feel and usually follow is
1. Check the rendered element in firebug, and check which class has been associated to that element through the widget.
2. If a css file exists with the widget, find the style defined for that class and append some style to that class.
3. If no css file exists for that widget, just add a class with same name and add you custom style to that putting that in your page or referenced stylesheet for that page.

I hope this would help.
Thanks


这篇关于使用jquery小部件自定义Grid的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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