是否可以通过调用任何函数来设置slickgrid选项的行高
我希望slickgrid的变量rowHeight通过调用任何函数取决于内容中的行数是否可以通过调用任何函数来设置slickgrid选项的行高,slickgrid,Slickgrid,我希望slickgrid的变量rowHeight通过调用任何函数取决于内容中的行数 this.getRowHeight = function(){ return 45; }; this.options = { rowHeight: this.getRowHeight }; 每行高度不可调整。这是在一个基本层次上构建到网格中的 鉴于此,如果您只想使用函数最初设置rowHeight,您需要 this.getRowHeight = function(){ r
this.getRowHeight = function(){
return 45;
};
this.options = {
rowHeight: this.getRowHeight
};
每行高度不可调整。这是在一个基本层次上构建到网格中的 鉴于此,如果您只想使用函数最初设置
rowHeight
,您需要
this.getRowHeight = function(){
return 45;
};
this.options = {
rowHeight: this.getRowHeight()
};
也就是说,您想要的是函数的结果,而不是函数本身。这是基本的javascript,与SlickGrid无关。谢谢@Ben。这是工作,但我想行的高度应该取决于内容。有可能吗?对不起,阿尼尔,这在SlickGrid是不可能的。行高用于整个核心渲染代码的计算。