Css jgGrid Navigator不显示图标
“我的网格”显示正确,但“导航器”按钮上的图标未显示。当您将鼠标悬停在按钮上时,按钮上有一个轮廓和一个工具提示,但按钮上没有图标,如“+”或垃圾桶 此外,是否有一种方法可以隐藏某些按钮而不是其他按钮,例如删除添加记录按钮,但保留删除记录按钮 我已经按照与样式表和语言文件相关的说明进行了操作。 下面是创建网格的代码:Css jgGrid Navigator不显示图标,css,jqgrid,Css,Jqgrid,“我的网格”显示正确,但“导航器”按钮上的图标未显示。当您将鼠标悬停在按钮上时,按钮上有一个轮廓和一个工具提示,但按钮上没有图标,如“+”或垃圾桶 此外,是否有一种方法可以隐藏某些按钮而不是其他按钮,例如删除添加记录按钮,但保留删除记录按钮 我已经按照与样式表和语言文件相关的说明进行了操作。 下面是创建网格的代码: // create the grid $(gridName).jqGrid({ // server url and other ajax s
// create the grid
$(gridName).jqGrid({
// server url and other ajax stuff
url: '/Admin/Blogs',
datatype: 'json',
mtype: 'GET',
height: 'auto',
shrinkToFit: false,
// columns
colNames: colNames,
colModel: columns,
// pagination options
toppager: false,
pager: pagerName,
rowNum: 10,
rowList: [10, 20, 30],
// row number column
rownumbers: true,
rownumWidth: 40,
// default sorting
sortname: 'PostedOn',
sortorder: 'desc',
// display the no. of records message
viewrecords: true,
jsonReader: { repeatitems: false }
});
$(gridName).navGrid(pagerName,
{
// settings
cloneToTop: true,
search: false
},
{}, // add options
{}, // edit options
{} // delete options
);
确保您的页面在css/images文件夹中有jquery-ui.js和jquery.ui.theme.css图标图像 关于隐藏某些按钮:
$(gridName).navGrid(pagerName,
{edit:false,search:false,del:true,add:true,view:false,refresh:false,cloneToTop: true},
// navigator options ( where true = show / false = hide )
{}, // add options
{}, // edit options
{} // delete options
);
如果要添加自定义按钮,只需为它们指定id并隐藏:
$('#buttonId').hide();
通过添加jquery.ui.theme.css和theme-images文件夹,一切都正常了