简体   繁体   English

N2 CMS中的互斥可编辑项

[英]Mutually Exclusive Editable Items in N2 CMS

I need two editable items to be mutually exclusive, such that when an admin user goes in to the edit interface and edits one, the other becomes greyed out (and blanked out). 我需要两个可编辑的项目才能互斥,这样,当管理员用户进入编辑界面并进行编辑时,另一个会变灰(并变黑)。

Let's say I have something like this: 假设我有这样的事情:

public sealed class MyPart : PartBase  
{
    [EditableTextBox]
    public string Text1 
    {
        get { return GetDetail(Names.Text1); }
        set { SetDetail(Names.Text1, value); }
    }

    [EditableTextBox]
    public string Text2
    {
        get { return GetDetail(Names.Text2); }
        set { SetDetail(Names.Text2, value); }
    }
}

In code, I can quite easily make these two text items mutually exclusive via the get/set functions, but how do I make them mutually exclusive in the N2 edit interface? 在代码中,我可以很容易地通过get / set函数使这两个文本项互斥,但是如何在N2编辑界面中使它们互斥呢? Such that when the user types text into the Text1 box, the Text2 box becomes greyed out and read only and/or blanked out? 这样,当用户在“文本1”框中键入文本时,“文本2”框变为灰色,并且只读和/或空白吗?

Is this achieved via a decoration/attribute in the code, or do I have to implement custom javascript? 这是通过代码中的修饰/属性来实现的,还是我必须实现自定义JavaScript?

If it is custom javascript, where and how do I plug my script into N2? 如果是自定义javascript,我在哪里以及如何将脚本插入N2?

Thanks. 谢谢。

在这里的N2论坛上得到了答案: http : //n2cms.codeplex.com/discussions/277768

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM