Ejemplo n.º 1
0
        public static MvcHtmlString GridButtonActionWindow(this HtmlHelper helper, string name, string headerText, int widthInPx = 300, int heightInPx = 200)
        {
            var wp  = new WindowParameters(name, headerText, "", "", widthInPx, heightInPx, "");
            var wdw = WindowBuilderHelper.CreateWindow(helper, wp);

            return(new MvcHtmlString(wdw.ToHtmlString()));
        }
Ejemplo n.º 2
0
        public static WindowBuilder CreateWindow(HtmlHelper helper, WindowParameters parameters)
        {
            var hlpr    = helper.Telerik();
            var winName = parameters.Name.ToUpper().EndsWith("WINDOW") ? parameters.Name : parameters.Name + "Window";
            var wdw     = hlpr.Window().Name(winName).Title(parameters.HeaderText);

            if (!String.IsNullOrEmpty(parameters.Controller))
            {
                wdw.HtmlAttributes(new Dictionary <string, object>()
                {
                    { "data-action", UrlHelper.GenerateContentUrl("~/" + parameters.Controller + "/" + parameters.Action, helper.ViewContext.HttpContext) },
                    { "data-values", HtmlHelperExtensions.SerializeToQueryString(parameters.RouteValues) }
                });
            }
            //.LoadContentFrom(parameters.Action,parameters.Controller,parameters.RouteValues)
            var loadXpos = (parameters.WidthInPx / 2) - 16;
            var loadYpos = (parameters.HeightInPx / 2) - 16;

            wdw.Content("<div class='window-loading t-loading' style='position:relative;top:" + loadYpos + "px;left:" + loadXpos + "px;width:16px;height:16px;'> </div><div class='window-contents' style='overflow:auto;'></div>")
            .Width(parameters.WidthInPx).Height(parameters.HeightInPx)
            .Resizable().Modal(true).Visible(false).Draggable(true);
            return(wdw);
        }