CRM 窗体定制技巧和代码

本文分享了CRM系统中窗体定制的实用技巧,包括修改标签样式、替换输入框为图片或文本、以及直接添加文本字段等操作的具体实现方法。

给大家共享一些经常用到的一些crmForm窗体定制技巧和代码:

1. 改变lable的样式(加粗,变色,大小)

/* change new_button field label style */
if (crmForm.all.new_button != null)
{
  
var field = crmForm.all.new_button_c;
  field.style.fontWeight 
= 'bold'// change font to bold
  field.style.fontSize = '12px'// change font size
  field.style.color = '#ff0000';  //change font color
}

 

2. 把输入框替换成图片

/* replace new_button_d to a button */
if (crmForm.all.new_button != null)
{
  
var field = crmForm.all.new_button_d;
  
var html = "<table border='0' cellspacing='0' cellpadding='0'><tr><img width='32' height='32' style='cursor:hand' src='/_imgs/ico_32_134.gif' alt='Click button' onclick='Button_OnClick()' /></tr></table>";
  field.innerHTML 
= html;
}
Button_OnClick 
= function()
{
  alert(
"button clicked!"); 
}

 

3. 把输入框替换成文本(使用replaceNode技术)

/* replace new_button_d to a label */
if (crmForm.all.new_button != null)
{
  
var html = document.createElement( "<TD id='new_button_d'>");
  html.innerText 
= "this is a lable";
  crmForm.all.new_button_d.replaceNode(buttonText);
}

 

4. 附加一个文本(无需新建attribute,直接用html绘出)

/* append text under new_button */
if(crmForm.all.new_button != null)
{
  
var html= document.createElement( "<LABEL>");
  html.innerText 
= "this is a text field";
  crmForm.all.new_button.parentNode.appendChild(html);
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值