我的一些jqGrids在導航欄上有一個奇怪的行爲。
對其中一些我使用默認的搜索和刷新按鈕,並在那裏導航區浮動左側出現在這些按鈕旁邊(不應該居中,因爲它應該)。
當我向搜索按鈕「搜索」添加文本時會發生最大的問題。這使得按鈕邊距被錯誤地計算,使得hober效果邊界比實際的按鈕寬度更短。
但就像我說過的,這隻發生在某些情況下,我無法弄清楚正確工作和不正確工作之間的區別。這不是瀏覽器問題,因爲它在所有瀏覽器中都是一樣的。jqgrid導航欄不能正確呈現
繼承人是截圖(注意與重點搜索按鈕和導航控件的位置!):
有任何人之前遇到過這個問題嗎?
這是我的配置的操作系統有這個問題的一個網格:
$('#ProductBrandListGrid').jqGrid({
url: '<%= ResolveUrl("~/Controls/ProductsControls/Controllers/ProductBrandController.ashx?method=GridDataList") %>',
datatype: 'json',
mtype: 'GET',
colNames: ['Name', 'Description', 'Actions'],
colModel: [
{ name: 'Name', index: 'Name', width: 100, align: 'left', resizable: true, sortable: true, searchoptions: { sopt: ['cn']} },
{ name: 'Description', index: 'Description', align: 'left', resizable: true, sortable: true, searchoptions: { sopt: ['cn']} },
{ name: 'act', index: 'act', width: 25, sortable: false, search: false },
],
pager: $('#ProductBrandListGridPager'),
rowNum: 15,
rowList: [10, 15, 20, 30, 50, 100],
sortname: 'Name',
sortorder: 'asc',
viewrecords: true,
imgpath: '',
caption: '',
width: 200,
height: 400,
gridComplete: function() {
var ids = jQuery("#ProductBrandListGrid").jqGrid('getDataIDs');
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
ce2 = "<input type='button' value='details' onclick='ProductBrandItemOpen(\"" + cl + "\")' />";
$("#ProductBrandListGrid").setRowData(ids[i], { act: ce2 });
}
}
});
/* Add this line to show search boxes on the header */
$('#ProductBrandListGrid').jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false });
/* Add this line to allow advanced search using the toolbar button */
$("#ProductBrandListGrid").jqGrid('navGrid', "#ProductBrandListGridPager", { search: true, edit: false, add: false, del: false, searchtext:"Search" });
謝謝, 亞歷克斯
按鈕可能是用一個固定的寬度同樣的成功。右鍵單擊它和「檢查元素」,並查看該CSS是否爲固定寬度 – ariel 2011-05-17 07:24:11
您提到的所有內容都是css [presentation]問題,與您的jqGrid – Val 2011-05-17 09:57:36
沒什麼關係哦,爲什麼您要使用''?屬性?它的不好的做法,你是擊敗jquerys使命lool :) – Val 2011-05-17 09:58:54