【问题标题】:How to make hyper-links clickable in EXTJS htmleditor如何在 EXTJS htmleditor 中使超链接可点击
【发布时间】:2014-01-02 08:10:04
【问题描述】:

我遇到了这个问题,并且正在努力让它发挥作用。终于找到了一个解决方案,所以想在这里发布它,以便有一天这对某人有用。

我有两个问题:

第一

在 EXTJS 手风琴面板中,我在所有面板中都有 HTMLEDITOR。每当其他面板展开/折叠时,即使数据来自文件并存储在变量中,编辑器中输入的数据也会消失(编辑器丢失内容)

第二次

在 HTMLEDITOR 中,如果内容包含超链接,则编辑器不允许单击,甚至 CTRL+CLICK 也不起作用。然而,标记的内容显示为超链接

谢谢 维卡斯DK

【问题讨论】:

    标签: extjs clickable


    【解决方案1】:

    我不明白一件事。我在问题中输入的代码怎么会被删除。我在之前的帖子中发布了以下代码,现在它不存在了。

    第一

    监听面板的展开事件,输入如下代码重置值;

    expand: function () 
    {
    var htmlEditor = Ext.getCmp(nodeId + '_desc_html_editor');
    htmlEditor.setReadOnly(false);
    htmlEditor.setValue(desc_html);//desc_html contains the value fetched from the file
    }
    

    第二

    使用以下 css 将超链接设为只读,然后如果调用 javascript 函数,则使用“父”。;

    <a href='javascript:void(0);' style='-webkit-user-modify: read-only; -moz-user-modify: read-only;' onclick='parent.functionName(\"parameter\")'>Click for Details</a>
    

    【讨论】:

      【解决方案2】:

      第一

      监听面板的展开事件,输入如下代码重置值;

      expand: function () 
      {
      var htmlEditor = Ext.getCmp(nodeId + '_desc_html_editor');
      htmlEditor.setReadOnly(false);
      htmlEditor.setValue(desc_html);//desc_html contains the value fetched from the file
      }
      

      第二次

      使用以下 css 将超链接设为只读,然后如果调用 javascript 函数,则使用“父”。;

      <a href='javascript:void(0);' style='-webkit-user-modify: read-only; -moz-user-modify: read-only;' onclick='parent.functionName(\"parameter\")'>Click for Details</a>
      

      第三

      使用汽车

      {
          xtype: 'component',
          autoEl: {
              tag: 'a',
              href: 'http://www.example.com/',
              html: 'Example.com'
          }
      }
      

      【讨论】:

        猜你喜欢
        • 2016-08-18
        • 2010-10-26
        • 1970-01-01
        • 2020-06-08
        • 2012-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-01-28
        相关资源
        最近更新 更多