Beispiel #1
0
 public TableConfiguration()
 {
     PagingConfiguration = new PagingControlConfiguration(this);
     _hiddenColumns      = new List <string>();
     FilterExpression    = "mvc-table-filter";
     Id = Guid.NewGuid().ToString("N");
 }
Beispiel #2
0
        public void RenderPageSize(PagingControlConfiguration pageConfig, int currentPageSize, string tableId, ControllerContext context)
        {
            if(pageConfig.PageSizes == null)
                return;

            var writer = WriterHelper.GetWriter(context);
            var name = StaticReflection.StaticReflection.GetMember((TableRequestModel m) => m.PageSize).Name;
            using (new ComplexContentTag("select", new Dictionary<string, object>() { {"data-target", tableId}, {"class", pageConfig.TableDefinition.FilterExpression + " mvc-table-page-size"}, {"name", name }}, writer))
            {
                foreach (var pageSize in pageConfig.PageSizes)
                {

                    if (currentPageSize == pageSize)
                    {
                        using (new ComplexContentTag("option", new { value = pageSize, selected = "selected" }, writer))
                        {
                            writer.Write(pageSize);
                        }
                    }
                    else
                    {
                        using (new ComplexContentTag("option", new { value = pageSize}, writer))
                        {
                            writer.Write(pageSize);
                        }
                    }
                    
                }

            }
        }
Beispiel #3
0
 public TableConfiguration()
 {
     PagingConfiguration = new PagingControlConfiguration(this);
     FilterExpression    = "mvc-table-filter";
     Id = Guid.NewGuid().ToString("N");
 }