2014-02-26 142 views
0

我有我的jQuery已經產生了劍道格:刪除列菜單從列

的jQuery:

divSearchGrid.kendoGrid({ 
      dataSource: { 
       transport: { 
        read: function (options) { 
         $.ajax({ 
          type: "POST", 
          url: urlSearch, 
          data: paramsSearch, 
          contentType: "application/json; charset=utf-8", 
          dataType: "json", 
          success: function (result) { 
          options.success(structuredData) 
          } 
         }) 
        } 
        , 
       schema: { 
        model: { 
         id: "GUID", 
         fields: { 
          StatusID: { editable: false, groupable: false, sortable: false }, 
          AttID: { editable: false, groupable: false, sortable: false }, 
          TaskID: { editable: false, nullable: true, groupable: true, type: 'number' }, 
          ServiceName: { editable: false, nullable: true, groupable: true }, 
          TaskDescription: { nullable: true, groupable: true }, 
          FolderDescription: { editable: false, nullable: true, groupable: true }, 
          FolderSubject: { editable: true, nullable: true, groupable: true }, 
          ServiceRequestID: { editable: false, nullable: true, groupable: true, type: 'number' }, 
          PSRID: { editable: false, nullable: true, groupable: true }, 
          PSRSubject: { editable: false, nullable: true, groupable: true } 
         } 
        } 
       }, 
       pageSize: 10 
      }, 
      batch: true, 
      groupable: true, 
      scrollable: true, 
      sortable: true, 
      reorderable: true, 
      resizable: true, 
      selectable: "row" 
      autoSync: true, 
      editable: true, 
      navigatable: true, 
      columns: columnList, 
      columnMenu: true, 
      filterable: true, 
      columnMenu: { 
       sortable: false 
      }, 
      pageable: { 
       refresh: true, 
       pageSizes: true, 
       buttonCount: 5 
      }, 
     }); 

現在,你可以在代碼中看到列菜單來爲每列網格。我希望它不應該出現在我的案例中的特定列是StatusID

任何人都可以幫助我解決這個問題嗎?

回答

0

下面的代碼可以幫助你實現這一目標:

在StatusID的地方,你可以把任何對要刪除列菜單列的名稱。

var grid = $('#YourGridID').data("kendoGrid"); 
grid.thead.find("[data-field=StatusID]>.k-header-column-menu").remove(); 
+0

非常感謝,解決方案爲我工作。 7分鐘後我會將其標記爲答案。 –

+0

@SohanBajpayee嗨M很高興提議的解決方案工作。 – 2014-02-26 06:42:08