2017-05-10 13 views
2

私は、このような何か私のセルを定義するためにcell_rendererを使用していますセルの値としてオブジェクトで作業していない。ここAG-グリッド列の検索が

   var testObject = {}; 
       testObject.headerName = "my header"; 
       testObject.field = each_branch; 
       testObject.width = 200; 
       testObject.cellClassRules = cell_class_rules; 
       testObject.cellRenderer = cell_renderer; 
       columnDefs.push(testObject); 

をtestObject .field = each_branchはjsonオブジェクトです。

したがってinbuild検索機能は、AG-グリッドでの作業ではありません。誰でもここで私を助けてくれますか?

+0

解決方法はありましたか?返信用 –

答えて

0

あなたの列にテキストフィルタ・プロパティを設定してみてください:銀からデフォルトのTextFormatterを

https://www.ag-grid.com/javascript-grid-filter-text/#gsc.tab=0

+0

おかげで、私はこれを使用してみましたが、私は、[対象オブジェクト]としてセルの値を見つけます。ここで生の価値をどのように得ることができますか? textCustomComparator:機能(フィルタ、値、filterText){ \t \tにconsole.log(フィルタ)。 \t \tはconsole.log(JSON.stringify(値))。 \t \tにconsole.log(filterText)。 \t} – undefined

0

:filterParamsオブジェクトでtextCustomComparator機能を実装し、その後

testObject.filter:'text', 
testObject.filterParams:{ 
... 
} 

と-gridが文字列表現を返しています。textFormatterをインクルードしてtextCustomComparatorに同じオブジェクトを返すと、v alueGetter:

filter: "agTextColumnFilter", 
filterParams: { 
    textCustomComparator: function (filter, value, filterText) { 
     //value is the object from valueGetter 
    }, 
    textFormatter: function(r) { 
     //this is the solution 
     return r; 
    }, 
    valueGetter: function getter(params) { 
     return { 
      ... 
     }; 
    } 
} 
関連する問題