示例#1
0
文件: VnrTabStrip.cs 项目: dtafe/vnr
        public static TabStripBuilder TabStripControl(this HtmlHelper helper, TabStripInfomation tab) 
        {

            Action<TabStripItemFactory> tabfact = new Action<TabStripItemFactory>(t =>
            {
                foreach (var s in tab.TabItems)
                {
                    //var str = "/" + s.Value.ControllerName + "/" + s.Value.ActionName;

                    //if (!string.IsNullOrEmpty(s.Value.ControllerName) || !string.IsNullOrEmpty(s.Value.ActionName))
                    if (!string.IsNullOrEmpty(s.Value.LoadContentFrom))
                    {
                        if (s.Value.Parameter!=null)
                        {
                            t.Add()
                            .Text(s.Key)
                                //.LoadContentFrom(s.Value.UrlService + "/" + s.Value.ActionName + "/" + s.Value.ControllerName + "/" + s.Value.Id)
                            .LoadContentFrom(s.Value.LoadContentFrom)
                            .Selected(s.Value.Selected);
                        }
                        t.Add()
                            .Text(s.Key)
                            //.LoadContentFrom(s.Value.UrlService + "/" + s.Value.ActionName + "/" + s.Value.ControllerName + "/" + s.Value.Id)
                            .LoadContentFrom(s.Value.LoadContentFrom)
                            .Selected(s.Value.Selected);
                    }
                    else
                    {
                        t.Add()
                           .Text(s.Key)
                           .Content(s.Value.Content)
                           .Selected(s.Value.Selected);
                    }
                }
               
            });

            Action<TabStripEventBuilder> tabe = new Action<TabStripEventBuilder>(e =>
            {
                if (!string.IsNullOrWhiteSpace(tab.Activate))
                {
                    e.Activate(tab.Activate);
                }
                if (!string.IsNullOrWhiteSpace(tab.ContentLoad))
                {
                    e.ContentLoad(tab.ContentLoad);
                } 
                if (!string.IsNullOrWhiteSpace(tab.Select))
                {
                    e.Select(tab.Select);
                }

            });

            return helper.Kendo().TabStrip()
                .Name(tab.Name)
                .Items(tabfact)
                .Events(tabe)
                ;
        }
示例#2
0
文件: VnrTabStrip.cs 项目: radtek/vnr
        public static TabStripBuilder TabStripControl(this HtmlHelper helper, TabStripInfomation tab)
        {
            Action <TabStripItemFactory> tabfact = new Action <TabStripItemFactory>(t =>
            {
                foreach (var s in tab.TabItems)
                {
                    //var str = "/" + s.Value.ControllerName + "/" + s.Value.ActionName;

                    //if (!string.IsNullOrEmpty(s.Value.ControllerName) || !string.IsNullOrEmpty(s.Value.ActionName))
                    if (!string.IsNullOrEmpty(s.Value.LoadContentFrom))
                    {
                        if (s.Value.Parameter != null)
                        {
                            t.Add()
                            .Text(s.Key)
                            //.LoadContentFrom(s.Value.UrlService + "/" + s.Value.ActionName + "/" + s.Value.ControllerName + "/" + s.Value.Id)
                            .LoadContentFrom(s.Value.LoadContentFrom)
                            .Selected(s.Value.Selected);
                        }
                        t.Add()
                        .Text(s.Key)
                        //.LoadContentFrom(s.Value.UrlService + "/" + s.Value.ActionName + "/" + s.Value.ControllerName + "/" + s.Value.Id)
                        .LoadContentFrom(s.Value.LoadContentFrom)
                        .Selected(s.Value.Selected);
                    }
                    else
                    {
                        t.Add()
                        .Text(s.Key)
                        .Content(s.Value.Content)
                        .Selected(s.Value.Selected);
                    }
                }
            });

            Action <TabStripEventBuilder> tabe = new Action <TabStripEventBuilder>(e =>
            {
                if (!string.IsNullOrWhiteSpace(tab.Activate))
                {
                    e.Activate(tab.Activate);
                }
                if (!string.IsNullOrWhiteSpace(tab.ContentLoad))
                {
                    e.ContentLoad(tab.ContentLoad);
                }
                if (!string.IsNullOrWhiteSpace(tab.Select))
                {
                    e.Select(tab.Select);
                }
            });

            return(helper.Kendo().TabStrip()
                   .Name(tab.Name)
                   .Items(tabfact)
                   .Events(tabe)
                   );
        }