2011-08-08 27 views
1

我有一個網格沒有太多的自定義渲染罰款grouping: false爲什麼在分組處於活動狀態時JqGrid會丟失最右邊的列邊框?

如果我打開分組,邊框消失,如截圖所示。

的關於邊界的一個細胞的CSS類ui-jqgridTR.ui-row-ltr TD具有邊框設置爲1px solid,但它實際上並沒有呈現。如果我關閉邊框屬性,它會將其從分組行和網格中的所有其他行中刪除。

有關如何獲取此邊框繪製的任何想法?謝謝!

電網定義的要求:

{ 
     colNames: ["ItemId", "DetailId", "UPC", "Ship Date", "Vendor", "VendorDisplay", "Item", "UPC", "Description", "Pack", "Ret", "Exp", "Inv", "Memo", "Distro", "Requst", "Reason"], 
     colModel: [ 
      { name: "ItemId", index: "ItemId", width: 1, hidden: true }, 
      { name: "DetailId", index: "DetailId", width: 1, hidden: true, editable: true }, 
      { name: "UPC", index: "UPC", width: 1, hidden: true }, 
      { name: "ShipDateDisplay", index: "ShipDateDisplay", width: 65, stype: "text", searchoptions: { dataInit: GridModels.Formatters.DatePicker, attr: { title: "Select Date"}} },     
      { name: "Vendor", index: "Vendor", width: 0, hidden: true, stype: "select", searchoptions: { searchhidden: true, value: "0:Vendor1;1:Vendor2"} },     
      { name: "VendorDisplay", index: "VendorDisplay", hidden: true }, 
      { name: "VendorItem", index: "VendorItem", width: 40, align: "Right" }, 
      { name: "UPC_DISPLAY", index: "UPC_DISPLAY", width: 70, align: "Right" }, 
      { name: "ItemDescription", index: "ItemDescription", width: 200 }, 
      { name: "CasePack", index: "CasePack", width: 35, align: "Right" }, 
      { name: "Retail", index: "Retail", width: 50, align: "Right", search: false, formatter: Store.Cuts.Common.RetailLoader },    
      { name: "InvQty", index: "InvQty", width: 50, align: "Right", search: false, formatter: Store.Cuts.Common.InventoryLoader }, 
      { name: "Memo", index: "Memo", width: 50 }, 
      { name: "Qty", index: "Qty", width: 30, align: "Right", search: false }, 
      { name: "StoreQty", index: "StoreQty", width: 35, align: "Right", search: false, editable: true, editrules: { required: true, integer: true, minValue: 0} }, 
      { name: "StoreReason", index: "StoreReason", width: 130, align: "Right", search: false, editable: true, edittype: "select", editoptions: { value: reasons} } 
     ], 
     editurl: editurl, 
     url: gridurl, 
     grouping: true, 
     groupingView: { 
      groupField: ['VendorDisplay'], 
      groupColumnShow: false, 
      groupText: ['<b>{0}</b>'], 
      groupDataSorted: true 
     }, 
     pager: pager, 
     height: 250, 
     rowNum: 20    
    }; 

$.extend($.jgrid.defaults, { 
      datatype: 'json', 
      height: "100%", 
      loadui: 'none', 
      jsonReader: { 
       root: "Rows", 
       page: "Page", 
       total: "Total", 
       records: "Records", 
       repeatitems: false, 
       userdata: "UserData", 
       id: "Id", 
       subgrid: 
       { 
        root: "Rows", 
        repeatitems: false 
       } 
      }, 
      mtype: 'GET', 
      autowidth: true, 
      sortable: true, 
      sortname: 'Id', 
      sortorder: 'asc', 
      rowNum: 10, 
      rowList: [10, 20, 50, 100], 
      viewrecords: true,    
      beforeRequest: function() { 
       $("#load_grid").html('<h4 style="display: inline; position: relative; top: -10px; font-weight: bold">Loading...</h4>' + $(".loader").html()); 
       Common.Grid.DisableControls(); 
      }, 
      loadComplete: function() { 
       if (!loadonce) 
        loadonce = true; 

       if ($("#grid").getGridParam("reccount") === 0) 
        Common.Grid.DisplayStatus("No records found..."); 
       else 
        Common.Grid.HideStatus(); 

       if (loadCompleteEx) 
        loadCompleteEx(); 
      }, 
      gridComplete: function() { 
       if (!loadonce) { 
        Common.Grid.LoadNavBar($(this)); 

        // Align check all checkbox better 
        $("th[id=grid_cb]") 
         .css("text-align", "center") 
         .css("position", "relative") 
         .css("left", "1px"); 
       } 

       if (gridCompleteEx) 
        gridCompleteEx(); 

       Common.Grid.EnableControls(); 
      } 
     }); 

您可以使用下面的JSON字符串來填充的測試數據網格導致我到底問題出在:

{"Total":1,"Page":1,"Records":3,"Rows":[{"Id":1,"Description":"","ShipDate":"/Date(-62135578800000)/","ShipDateDisplay":"01/01/0001","Type":null,"IsAvailableToStores":false,"IsReadOnly":false,"IsStoreFinalized":false,"IsHQFinalized":false,"IsDeleted":false,"BuyerId":0,"Buyer":null,"Memo":null,"ItemId":0,"Vendor":"01111","VendorDisplay":"1111 - ","VendorName":null,"VendorItem":null,"UPC_DISPLAY":"00000-01111","UPC":"1111","ItemDescription":"Test","CasePack":0,"RetailAmt":0,"RetailMult":0,"Retail":"$0.00","SaleAmt":0,"SaleMult":0,"ExpressAmt":null,"ExpressMult":null,"InvQty":0,"DetailId":0,"StoreNumber":0,"StoreName":null,"OriginalQty":0,"BuyerQty":0,"Qty":0,"StoreQty":0,"StoreReason":null,"FinalQty":0},{"Id":2,"Description":"","ShipDate":"/Date(-62135578800000)/","ShipDateDisplay":"01/01/0001","Type":null,"IsAvailableToStores":false,"IsReadOnly":false,"IsStoreFinalized":false,"IsHQFinalized":false,"IsDeleted":false,"BuyerId":0,"Buyer":null,"Memo":null,"ItemId":0,"Vendor":"01111","VendorDisplay":"1111 - ","VendorName":null,"VendorItem":null,"UPC_DISPLAY":"00000-01111","UPC":"1111","ItemDescription":"Test","CasePack":0,"RetailAmt":0,"RetailMult":0,"Retail":"$0.00","SaleAmt":0,"SaleMult":0,"ExpressAmt":null,"ExpressMult":null,"InvQty":0,"DetailId":0,"StoreNumber":0,"StoreName":null,"OriginalQty":0,"BuyerQty":0,"Qty":0,"StoreQty":0,"StoreReason":null,"FinalQty":0},{"Id":3,"Description":"","ShipDate":"/Date(-62135578800000)/","ShipDateDisplay":"01/01/0001","Type":null,"IsAvailableToStores":false,"IsReadOnly":false,"IsStoreFinalized":false,"IsHQFinalized":false,"IsDeleted":false,"BuyerId":0,"Buyer":null,"Memo":null,"ItemId":0,"Vendor":"02222","VendorDisplay":"2222 - ","VendorName":null,"VendorItem":null,"UPC_DISPLAY":"00000-01111","UPC":"1111","ItemDescription":"Test","CasePack":0,"RetailAmt":0,"RetailMult":0,"Retail":"$0.00","SaleAmt":0,"SaleMult":0,"ExpressAmt":null,"ExpressMult":null,"InvQty":0,"DetailId":0,"StoreNumber":0,"StoreName":null,"OriginalQty":0,"BuyerQty":0,"Qty":0,"StoreQty":0,"StoreReason":null,"FinalQty":0}],"UserData":null} 
+0

您能否包含可用於重現問題的網格定義?簡單的[分組演示](http://www.ok-soft-gmbh.com/jqGrid/Grouping1.htm)或其他更復雜的例子,如[this](http://www.ok-soft-gmbh.com) /jqGrid/AbhishekSimon8.htm)沒有描述的問題。 – Oleg

+0

@Oleg添加了代碼...讓我知道你是否需要更多細節。 – IronicMuffin

+0

ondblClickRow和onSelectRow方法似乎並不重要,因爲您在網格加載時已經有問題了。我需要的是產生問題的測試數據。我看不到'datatype'定義。你使用默認的'datatype:'xml''數據類型嗎? – Oleg

回答

1

的代碼你發佈包括許多未定義的功能,如自定義格式化程序等。在我評論了所有未知部分後,我收到了the demo,它沒有你描述的效果。沒有你沒有發佈的代碼部分,可能你描述的問題就不存在了。如果您發佈可用於查看現場問題的URL(當然,使用未經最小化的jqGrid代碼jquery.jqGrid.src.js),我可以看看裏面的內容。

+0

謝謝你的繼續幫助。今天早上睡了一覺並更容易排除故障後,我發現它有什麼問題。請看我發佈的答案。你會認爲這是一個應該在jqGrid論壇上報告的錯誤嗎? – IronicMuffin

+0

@IronicMuffin:不客氣!在使用內聯編輯之後,不要發佈「原因」的值,也不要描述只有問題*。從我的角度來看,這是你在上一篇文章中描述的一個錯誤。所以我建議你用'editoptions.value'中的長字符串準備一個小演示,並簡單地使用內聯編輯。您應該發佈到[trirand](http://www.trirand.com/blog/?page_id=393/bugs/)的演示,以便Tony(jqGrid的開發人員)能夠修復該錯誤。 – Oleg

+0

我想我太激動了。現在它在我調整列的大小時顯現並消失。我想我對寬度參數感到幸運。如果拖動列以使網格需要水平滾動條,然後調整大小,則可能會出現,也可能不會出現。這很奇怪。 – IronicMuffin

相關問題