gpt4 book ai didi

javascript - SuiteCRM ListView 条件格式

转载 作者:行者123 更新时间:2023-11-28 00:17:01 27 4
gpt4 key购买 nike

我试图弄清楚如何根据下拉选择使我的 SuiteCRM 数据库中的 ListView /子面板行具有某种颜色。例如,如果从下拉列表中选择“已验证”,则该行应为黄色。

我知道你可以使用逻辑钩子(Hook)和 JavaScript 的组合来以某种方式做到这一点,但这超出了我微薄的编码能力。有人有什么建议吗?

谢谢!

最佳答案

您可以使用以下代码在 custom/modules/modulename/views/view.list.php 中自定义 view.list.php 来更改 ListView 中的颜色:

<?php
require_once('include/MVC/View/views/view.list.php');
require_once('custom/modules/Leads/LeadsListViewSmarty.php');
class LeadsViewList extends ViewList {
/**
* @see ViewList::preDisplay()
*/
public function preDisplay() {
$jsscript = <<<EOQ
<script>
$(document).ready(function(){
$("form#MassUpdate table.list.view td:contains('Not Changed')").css('background-color', 'Green');
$("form#MassUpdate table.list.view td:contains('Station Changed')").css('background-color', 'red');
});
</script>
EOQ;
parent::preDisplay();
echo $jsscript; //echo the script
$this->lv = new LeadsListViewSmarty();
}
}
?>

关于javascript - SuiteCRM ListView 条件格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30375974/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com