문제

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? Such that when the user types text into the Text1 box, the Text2 box becomes greyed out and read only and/or blanked out?

Is this achieved via a decoration/attribute in the code, or do I have to implement custom javascript?

If it is custom javascript, where and how do I plug my script into N2?

Thanks.

도움이 되었습니까?

해결책

Got an answer on the N2 forums here: http://n2cms.codeplex.com/discussions/277768

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top