找回密码
 注册成为天翎用户
查看: 667|回复: 5

[已解决] 视图行变红色

[复制链接]
北京智源普华 发表于 2014-10-27 16:33:52 | 显示全部楼层 |阅读模式
本帖最后由 nice 于 2014-10-28 18:35 编辑

var state= getItemValueAsString("BIDSTATE");
println("state"+state);//状态为中标
if(state=="中标"){
col +="<script>";
col += "var obj=document.getElementsByName('_selects'); for(var i=0;i<obj.length;i++){if(obj.value == '" + getId() + "') {obj.parentNode.parentNode.bgColor = 'red';break;}};";
col += "</script>";
}
col;
运行代码后col为空 没有实现渲染  看到后忘回答
QQ:771889237
TEL:18254126329
nice 发表于 2014-10-28 09:43:21 | 显示全部楼层
1.你看看你的col定义了没有!目前完全没看见!
回复

使用道具 举报

 楼主| 北京智源普华 发表于 2014-10-28 10:33:53 | 显示全部楼层
回复 2# nice


    var state= getItemValueAsString("BIDSTATE");
println("state"+state);//状态为中标
var col="";
if(state=="中标"){
col +="<script>";
col += "var obj=document.getElementsByName('_selects'); for(var i=0;i<obj.length;i++){if(obj.value == '" + getId() + "') {obj.parentNode.parentNode.bgColor = 'red';break;}};";
col += "</script>";
}
println("col=="+col)
col;

后台打印

后台打印

这是定义之后后台打印情况,未渲染
回复

使用道具 举报

nice 发表于 2014-10-28 12:01:18 | 显示全部楼层
先建立查询表单
在源码加入:
<script>
jQuery(document).ready(function(){
        setTimeout(function(){
                jQuery("div.changeColor").each(function(){
                                        jQuery(this).parents("tr").css("backgroundColor","red");
                });
        },300);
});
</script>

然后视图列:
var state= getItemValueAsString("BIDSTATE");
if(state=="中标"){
state += "<div class='changeColor' style='display:none;'></div>";
}
state;
回复

使用道具 举报

 楼主| 北京智源普华 发表于 2014-10-28 12:59:21 | 显示全部楼层
该贴结贴!!!!!
回复

使用道具 举报

nice 发表于 2014-10-28 13:00:13 | 显示全部楼层
感谢回帖!
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 01:45

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表