1
我无法在列中显示新行.Below是我的代码。AngularJS:UI网格显示使用过滤器的单元格中的多行
tests = "TC2148 (test1),TC2150 (test2),TC2149 (test3)";
{ field:'tests', displayName:'TestID's', cellTooltip: true, minWidth:110, visible: true , cellFilter : 'filterTests:this' }
testApp.filter('filterTests',function(){
return function(value){
value = value.replace(/ *\([^)]*\) */g, "")
.replace(/,/g,"\n");
return value;
}
});
如果你有嵌套圆括号,你需要阅读[用一行JavaScript去除嵌套模式](http://blog.stevenlevithan.com/archives/reverse-recursive-pattern)。你会看到你只需要'while(value!=(value = value.replace(/ \ s * \([^()] * \)/ g,“”)));返回值;' –
请在这里发布答案 http://stackoverflow.com/questions/43114069/replace-content-present-in-the-nested-brackets 非常感谢! – Coded9
我的答案在下面有帮助吗?你还需要什么别的吗? –