Example #1
0
 public GridTagWriter(IColumnPolicies policies, ITemplateWriter templates, IAssetRequirements assets, IUrlRegistry urls, T grid)
 {
     _policies  = policies;
     _templates = templates;
     _assets    = assets;
     _urls      = urls;
     _grid      = grid;
 }
Example #2
0
 public GridTagWriter(IColumnPolicies policies, ITemplateWriter templates, IAssetRequirements assets, IUrlRegistry urls, T grid, IFieldAccessService accessService)
 {
     _policies      = policies;
     _templates     = templates;
     _assets        = assets;
     _urls          = urls;
     _grid          = grid;
     _accessService = accessService;
 }
        private SlickGridFormatter determineFormatter(IGridDefinition grid, IColumnPolicies policies)
        {
            if (grid.DefaultFormatter != null)
            {
                return(grid.DefaultFormatter);
            }

            if (grid.UsesHtmlConventions)
            {
                Property("displaySubject", TemplateWriter.SubjectFor(Accessor, ElementConstants.Display));
                return(SlickGridFormatter.Underscore);
            }

            return(policies.FormatterFor(Accessor));
        }
        public void SelectFormatterAndEditor(IGridDefinition grid, IColumnPolicies policies)
        {
            if (Editor() == null && grid.AllColumnsAreEditable)
            {
                if (grid.UsesHtmlConventions)
                {
                    Editor(SlickGridEditor.Underscore);
                    Property("editorSubject", TemplateWriter.SubjectFor(Accessor, ElementConstants.Editor));
                }
                else
                {
                    Editor(policies.EditorFor(Accessor));
                }
            }

            if (Formatter() == null)
            {
                var formatter = determineFormatter(grid, policies);
                if (formatter != null)
                {
                    Formatter(formatter);
                }
            }
        }
 void IGridDefinition.SelectFormattersAndEditors(IColumnPolicies editors)
 {
     _columns.Each(x => x.SelectFormatterAndEditor(this, editors));
 }
 public void SelectFormattersAndEditors(IColumnPolicies editors)
 {
     throw new NotImplementedException();
 }