2017-07-03 31 views
0

我正在使用dojo增強網格視圖。我能夠在UI中顯示網格。但是AnyColumn選項被添加爲新列。AnyColumn選項添加爲Dojo增強網格視圖中的新列

例子: enter image description here


任何幫助將不勝感激...

這裏是代碼

var mygrid = new EnhancedGrid({ 
    id: "grid", 
    store: gridStore, //Data store passed as input 
    structure: gridStructure, //Column structure passed as input 
    autoHeight: true, 
    autoWidth: true, 
    initialWidth: width, 
    canSort : true, 
    plugins: { 
     filter: { 
      //Filter operation 
      isServerSide: true, 
      disabledConditions : {"anycolumn" : ["equal","less","lessEqual","larger","largerEqual","contains","startsWith","endsWith","equalTo","notContains","notEqualTo","notStartsWith","notEndsWith"]}, 
      setupFilterQuery: function(commands, request){ 
       if(commands.filter && commands.enable){ 
        //filter operation 
       } 
       } 
      } 
}, dojo.byId("mydatagrid")); 


mygrid.startup(); 

感謝, Lishanth

+1

請發佈代碼和內聯圖片 – Marged

+0

謝謝Marged ...添加了代碼,您可以幫助解決這個問題。 –

回答

1

首先,不要使用增強型網格,而不是使用dgrid或gridx。

我認爲默認情況下,anycolumn被添加到下拉列表中。如果要刪除的話,我會建議

  1. 註冊過濾器定義
  2. 迭代通過下拉點擊事件,並刪除第一項,這anyColumn

,或者你也可以嘗試像

dojo.forEach(this.yourgrid.pluginMgr.getPlugin('filter').filterDefDialog._cboxes, function(dropdownbox) { 

dropdownbox._colSelect.removeOption(dropdownbox.options[0]); 
}); 

更新的答案是。我知道這不是這樣做的優雅方式,但它的工作原理。

//reason why I'm showing the dialog is that _cboxes of the filter are empty initially. 
    dijit.byId('grid').plugin('filter').filterDefDialog.showDialog(); 
dojo.forEach(dijit.byId('grid').pluginMgr.getPlugin('filter').filterDefDialog._cboxes, function(dropdownbox) { 

      var theSelect = dropdownbox._colSelect; 
      theSelect.removeOption(theSelect.options[0]); 
      }); 

//Closing the dialog after removing Any Column 
      dijit.byId('grid').plugin('filter').filterDefDialog.closeDialog(); 
+0

感謝manjunatha-muniyappa ...你的代碼不適合我。它不會刪除任何列。 –

+0

@Lishanth,你可以發佈你的代碼嗎? –

+0

代碼已發佈... –

相關問題