如何更改jqgrid的颜色主题和字体大小 [英] How to change color theme and font size of jqgrid

查看:940
本文介绍了如何更改jqgrid的颜色主题和字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在MVC 4,jquery和jqgrid中创建了应用程序.

I have created application in MVC 4, jquery and jqgrid.

我在以下页面之一中使用了jqgrid:

I have used jqgrid in one of page as below:

          $('#g).jqGrid({
            ajaxGridOptions: {
                error: function () {
                    $('#g')[0].grid.hDiv.loading = false;
                    alert('An error has occurred.');
                }
            },
            url: '@Url.Action("Getvalues", "cntrollName")/' + 0,
            postData: { ID: rowID },
            datatype: 'json',
            jsonReader: { root: 'List', page: 'Page', total: 'TotalPages', records: 'TotalCount', repeatitems: false, id: 'ID' },
            mtype: 'GET',
            colNames: ['GrdID', Name],
            colModel: [
                { name: ID, index: ID, hidden: true },
                { name: 'FullName', index: 'FullName', width: 150 }
                                ],
            pager: $('#g),
            sortname: ID,
            rowNum: 10,
            width: '525',
            height: '100%',
            viewrecords: true,
            beforeSelectRow: function (rowid, e) {
                                   return true;
            },
            sortorder: 'desc'
        }).navGrid('#g, { edit: false, add: false, del: false, search: false, refresh: false });

请分享给我如何更改jqgrid的颜色和字体大小.

目前,它仅显示默认的浅蓝色主题及其默认字体大小.

For now, it just shows default light blue theme and its default font size.

谢谢

推荐答案

jqGrid基于jQuery UI主题.要更改颜色,您可以下载主题(请参见此处),然后在底部的下拉菜单中选择主题页)或在此处自定义主题.通过这种方式,您可以轻松更改所有颜色.

jqGrid are based on jQuery UI Theme. To change colors you can either download the theme (see here and choose the theme at the dropdown at the bottom of the page) or customize your own theme here. In the way you can easy change all colors.

要更改字体大小,您将必须覆盖ui.jqgrid.css中定义的某些CSS样式.只需使用像素值搜索font-sizeheight.如果需要增加字体大小,则需要增加网格部分的某些height值.

To change the font size you will have to overwrite some CSS styles defined in ui.jqgrid.css. Just search for font-size and height with pixel values. If you will need to increase the font size you will need to increase some height values of grid's parts.

这篇关于如何更改jqgrid的颜色主题和字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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