是否可以通过调用任何函数来设置 slickgrid 选项的 rowHeight

Is it possible to set rowHeight of slickgrid options by calling any function

我想要 slickgrid 的变量 rowHeight 取决于编号。通过调用任何函数在内容中的行数。

this.getRowHeight = function(){
    return 45;
};

this.options = {    
    rowHeight: this.getRowHeight    
};

每行的行高不可调整。这在基本层面内置于网格中。

鉴于此,如果您只想使用您的函数初始设置 rowHeight,您需要

this.getRowHeight = function(){
    return 45;
};

this.options = {    
    rowHeight: this.getRowHeight()   
};

也就是说,您想要函数的结果,而不是函数本身。这是基本的 javascript,与 SlickGrid 无关。