簡體   English   中英

有關JqGrid的問題

[英]Questions About and Issues With JqGrid

我確定我的問題已在某處得到解決,但是我已經研究了一段時間,而且似乎找不到我要找的答案。

  • 使用inlineNav功能時,是否有“刪除”選項? 我還沒有找到任何東西,因此要使用它,我必須同時使用navGridinlineNav功能創建網格,如下所示:
  $("#attributeEditList").jqGrid( { 
            datatype: "local",
            height: 150,
            colNames: ['rowid', 'Vendor', 'Category', 'Key', 'Value', 'Flags', 'Status'], 
            colModel: [
                        {name: 'rowid', index: 'rowid', hidden: true, key: true},
                        {name: 'vendorCode', index: 'vendorCode', hidden: true},
                        {name: 'category', index: 'category', width: 120, editable: true, editrules:{required: true} }, 
                        {name: 'key', index: 'key', width: 120, editable: true, editrules:{required: true} }, 
                        {name: 'value', index: 'value', width: 200, editable: true, editrules:{required: true} }, 
                        {name: 'flags', index: 'flags', width: 80, editable: true, editrules:{required: true, integer: true} }, 
                        {name: 'status', index: 'status', hidden: true }
                      ], 
            sortname: "category", 
            viewrecords: true,
            caption: "Attributes",
            rowNum: 20000,
            pager: '#attributeEditPager',
            editurl: "vendor/ajax/dummy.do",
            data: vendor.attributes,
            jsonReader : { repeatitems: false }
          });
          $("#attributeEditList").jqGrid( "navGrid", '#attributeEditPager', {
              edit: false, 
              add: false, 
              del: true,
              search: false,
              refresh: false,
              delfunc: deleteAttribute
            }
          );  
          $("#attributeEditList").jqGrid( "inlineNav", '#attributeEditPager' );  
  • 有什么方法可以嚴格在客戶端進行網格中的編輯嗎? 我希望我的用戶能夠進行幾次編輯(添加/編輯/刪除),然后將網格中的所有更改以及網格以外的其他一些表單更改發布到服務器上。 據我所知, editurl參數是必需的,並且實際上必須是有效的url,以便編輯工作。
  • 最后,我認為這是我使用inlineNav功能時遇到的最大問題。 首先,我單擊“添加(+)”按鈕添加一行,添加數據,然后單擊“保存”按鈕。 然后,如果我再次單擊“添加”按鈕,則會添加新行,但“添加”和“編輯”按鈕仍處於活動狀態,而“保存”和“取消”按鈕仍處於禁用狀態。

如果您對這些問題有任何建議,請告訴我。

舊答案中查看演示此我演示了如何在jqGrid中實現本地表單編輯。 您的第一個問題是關於navGrid添加的“刪除”。 因此,您可以在設置processing: true使用此技巧processing: true ,我建議使“刪除”按鈕在本地工作。 您還應該使用editurl: 'clientArray' 我大約在一年前就向Trirand發布了我的建議(請參閱此處 ),但是本地表單編輯仍然不是jqGrid的一部分。

沒錯,在很多情況下inlineNav並且如果用戶以其他順序單擊按鈕,則會激活或禁用錯誤的按鈕。 您必須使用$("#attributeEditList_ilsave").removeClass('ui-state-disabled');手動激活/停用按鈕$("#attributeEditList_ilsave").removeClass('ui-state-disabled'); $("#attributeEditList_ilsave").addClass('ui-state-disabled'); 按鈕的id將由gridid和后綴“ _iladd”,“ _ iledit”,“ _ ilsave”,“ _ ilcancel”構造。 我建議您在onSelectRowbeforeSelectRow包含此類代碼,直到在jqGrid的主要代碼中未修復錯誤為止。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM