Skip to content

Commit 1fa2d52

Browse files
committed
Exposed ExpandRelated to the view and view model
The `TopicQueryOptions.ExpandRelated` value is now relayed via the `RelationshipAttributeTopicViewModel` to its view, which uses that to configure the web service call used to bind the `SelectableTreeView` control. This allows users to configure whether or not a relationship should automatically be expanded as part of the `RelationshipAttribute` configuration in OnTopic.
1 parent ce81cc8 commit 1fa2d52

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Relationship/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script type="text/javascript">
1717
Ext.onReady(function(){
1818
var tree = new OnTopic.SelectableTreeView({
19-
dataUrl : '/OnTopic/Json/@rootTopicKey?ShowRoot=@descriptor.ShowRoot&ShowAll=true&RelatedNamespace=@descriptor.Key&RelatedTopicID=@Model.CurrentTopic.Id&AttributeName=@descriptor.AttributeKey&AttributeValue=@descriptor.AttributeValue',
19+
dataUrl : '/OnTopic/Json/@rootTopicKey?ShowRoot=@descriptor.ShowRoot&ShowAll=true&RelatedNamespace=@descriptor.Key&RelatedTopicID=@Model.CurrentTopic.Id&AttributeName=@descriptor.AttributeKey&AttributeValue=@descriptor.AttributeValue&ExpandRelated=@descriptor.ExpandRelated',
2020
checkAscendants : @((descriptor.CheckAscendants is true).ToString().ToLower()),
2121
backingField : '@Html.IdFor(m => m.Value)'
2222
});

OnTopic.Editor.Models/Metadata/RelationshipAttributeTopicViewModel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ public class RelationshipAttributeTopicViewModel: QueryableTopicListAttributeTop
2525
/// </summary>
2626
public bool? ShowRoot { get; set; }
2727

28+
/*==========================================================================================================================
29+
| PROPERTY: EXPAND RELATED?
30+
\-------------------------------------------------------------------------------------------------------------------------*/
31+
/// <summary>
32+
/// Determines whether or not the tree panel should be expanded to ensure visibility of any related (checked)
33+
/// relationships upon load. Defaults to <c>true</c>.
34+
/// </summary>
35+
public bool? ExpandRelated { get; set; }
36+
2837
/*==========================================================================================================================
2938
| PROPERTY: CHECK ASCENDANTS
3039
\-------------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)