改造 treeview.htc

-W B W Y-
2005 03 30

1、修改"retrieving nodes..." 为中文"请稍候..."

打开wwwroot/webctrl_client/1_0/treeview.htc,查找替换"retrieving nodes..." 为中文"请稍候...",保存编码为UTF-8,否则会出现乱码。

2、显示ToolTips

打开wwwroot/webctrl_client/1_0/treeview.htc,按如下代码更改。

function generateItem(el, nodeClass)
{ ...
str = getNodeAttribute(el, "Target");
if (str != null)
elAnchor.target = str;
//增加tooltips
str = getNodeAttribute(el, "ToolTips");
if (str != null)
elAnchor.title = str;
...

使用treenode.setAttribute("ToolTips","some text");增加ToopTips属性。

3、解决setAttribute("Expanded",true)的错误

打开wwwroot/webctrl_client/1_0/treeview.htc,按如下代码更改。

function doNodePlusMinusClick(el)
{
if (g_bInteractive == false)
return false;

// The element, which is in a content node outside of the document, is outside the event hierarchy.
// Fire the event ourselves, rather than relying on bubbling.
//判断event是否为空
if(event!=null)event.cancelBubble = true;

...

4、使节点treenode不能被选择

打开wwwroot/webctrl_client/1_0/treeview.htc,按如下代码更改。

function doNodeClick(el)
{
    if (g_bInteractive == false)
        return;
       
    g_nodeClicked = el;

    // The element, which is in a content node outside of the document, is outside the event hierarchy.
    // Fire the event ourselves, rather than relying on bubbling.
    event.cancelBubble = true;
    el.fireEvent("onclick");        // Execute our onclick handler
    //不能选择,则屏蔽事件
    var str = getNodeAttribute(el, "UnSelect");
    if (str != null && str == "true")
  return false;
  ...

  使用treenode.setAttribute("UnSelect","true");增加UnSelect属性。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值