Example #1
0
 public static MvcHtmlString TreeViewCr <TModel>(this HtmlHelper helper, TreeInfo info, string name, TreeViewEventBuilder events) where TModel : IViewModel, new()
 {
     return(TreeViewCr <TModel>(helper, info, name, events, false));
 }
Example #2
0
        public static MvcHtmlString TreeViewBoxCr <TModel>(this HtmlHelper helper, TreeInfo info, string name, TreeViewEventBuilder events) where TModel : IViewModel, new()
        {
            var treeViewHtmlString = helper.TreeViewCr <TModel>(info, name, events).ToHtmlString();

            return(CreateToolBox <TModel>(helper, info, name, treeViewHtmlString));
        }
Example #3
0
        public static MvcHtmlString TreeViewCr <TModel>(this HtmlHelper helper, TreeInfo info, string name, TreeViewEventBuilder events, bool hasCheckBox) where TModel : IViewModel, new()
        {
            info.DataSource.ModelCr.ModelType = typeof(TModel);

            var initializer = DI.Current.Resolve <IJavaScriptInitializer>();

            info.Name = name;

            TreeView tree = new TreeView(helper.ViewContext, initializer, info, hasCheckBox);

            tree.Events = events.handler;

            tree.DataTextField = info.DataTextField;

            var builder = new TreeViewBuilder(tree);

            return(MvcHtmlString.Create(builder.ToHtmlString()));
        }