Dom 为Netsuite suitelet添加颜色';s子列表行,具体取决于结果
是否有任何方法根据条件向子列表的行添加颜色。我已加载保存的搜索,以在子列表上显示输出。但现在我想突出显示今天日期和审核日期(搜索输出)之间的差异是否超过100天的行Dom 为Netsuite suitelet添加颜色';s子列表行,具体取决于结果,dom,colors,netsuite,suitescript,saved-searches,Dom,Colors,Netsuite,Suitescript,Saved Searches,是否有任何方法根据条件向子列表的行添加颜色。我已加载保存的搜索,以在子列表上显示输出。但现在我想突出显示今天日期和审核日期(搜索输出)之间的差异是否超过100天的行 var search = nlapiLoadSearch('customrecord_cseg_properties', 'customsearch52'); var columns=search.getColumns(); var sublist = form.addSubList('customsublist', 'st
var search = nlapiLoadSearch('customrecord_cseg_properties', 'customsearch52');
var columns=search.getColumns();
var sublist = form.addSubList('customsublist', 'staticlist', 'List of properties');
for(var i = 0; i< columns.length; i++){
sublist.addField('customcolumn'+i, 'text', columns[i].getLabel());
}
var result= search.runSearch();
var resultIndex = 0,resultStep = 1000,resultSet,resultSets = [];
do {
resultSet = result.getResults(resultIndex, resultIndex + resultStep);
resultSets = resultSets.concat(resultSet);
resultIndex = resultIndex + resultStep;
} while (resultSet.length > 0);
nlapiLogExecution('DEBUG','The Total number of rows is',resultSets.length);
for(var w= 0; w<resultSets.length ;w++){
for(var x=0; x<columns.length; x++){
var temp;
temp=resultSets[w].getText(columns[x]);
if(temp==null || temp==''){
temp=resultSets[w].getValue(columns[x]);
}
sublist.setLineItemValue('customcolumn'+x, Number(w)+1,temp);
}
var search=nlapiLoadSearch('customrecord_cseg_properties','customsearch52');
var columns=search.getColumns();
var sublist=form.addSubList('customsublist','staticlist','List of properties');
对于(var i=0;i0);
nlapiLogExecution('DEBUG','thetotalnumber of rows is',resultSets.length);
对于(var w=0;w而言,没有用于此的本机api。
您可以通过在客户端脚本onInit函数上维护DOM来实现这一点
请记住,DOM操作是有风险的,因为如果NetSuite更改DOM结构,它们可能会中断。嘿,Igor,谢谢你回答,实际上我正在尝试使用oninit上的客户端脚本来操作它。下面是我在客户端脚本var trDom=document.getElementById(“customsublist0”)上使用的代码;var-trDomChild=trDom.children;for(var t=0;t<(trDomChild.length-1);t+=1){var-tdDom=trDomChild[t];tdDom.setAttribute('style','background-color:'+tdColor+'!important;边框颜色:白色'+tdColor+'+tdColor+'+tdColor+'+tdColor+'!important;');}但它不能读取null的属性,如果您在客户端脚本上执行此操作,那么只需使用jQuery设置行颜色,就像您在任何其他html页面上所做的那样。