agSelectCellEditor dynamic list

心不动则不痛 提交于 2019-11-29 17:37:40

You can define your cellEditorParams function in a way that returns different values depending on values of another column.

Here is a sample from the ag-grid site -

cellEditor : 'agSelectCellEditor';
cellEditorParams: function(params) {
    var selectedCountry = params.data.country;
    if (selectedCountry==='Ireland') {
        return {
            values: ['Dublin','Cork','Galway']
        };
    } else {
        return {
            values: ['New York','Los Angeles','Chicago','Houston']
        };
    }
}

Take a look at this example from official docs. You will have to replace agRichSelectCellEditor with agSelectCellEditor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!