コード例 #1
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = "div";
            output.Content.Clear();
            string id = "tree";

            if (Id.IsPresent())
            {
                id = $"tree-{Id}";
            }
            JsTree tree = new JsTree(_dataAccessor, _rbacService, _applicationContext, id);

            tree.SetAsync(IsAsync);
            if (IsOrgdept)
            {
                tree.IsOrgDept();
            }
            if (GetUrl.IsPresent())
            {
                tree.SetUrl(GetUrl);
            }
            if (EditUrl.IsPresent())
            {
                tree.SetEditUrl(EditUrl);
            }
            if (JsonData.IsPresent())
            {
                tree.SetJsonData(JsonData);
            }
            if (TreeMode != null)
            {
                tree.SetTreeModel(TreeMode);
            }
            if (OnOpenNoded.IsPresent())
            {
                tree.OnOpenNodedEvent(OnOpenNoded);
            }
            if (OnLoaded.IsPresent())
            {
                tree.OnLoadedEvent(OnLoaded);
            }
            tree.SetPluginDnd(PluginDnd);
            tree.SetPluginCheckBox(PluginCheckbox);
            output.Content.AppendHtml(tree.ToString());
        }