Beispiel #1
0
        public void TestGridFilterHeaderRenderer()
        {
            var settings = new QueryStringFilterSettings();
            var renderer = new QueryStringFilterColumnHeaderRenderer(settings);

            var column = new GridColumn<TestModel, string>(c => c.Title, new TestGrid(Enumerable.Empty<TestModel>()));

            var htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            var html = htmlstring.ToHtmlString();
            Assert.IsTrue(string.IsNullOrEmpty(html));

            column.Filterable(true);

            htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            html = htmlstring.ToHtmlString();

            Assert.IsTrue(!string.IsNullOrWhiteSpace(html));

            Assert.IsTrue(html.Contains("data-filterdata="));
            Assert.IsTrue(html.Contains("class=\"grid-filter\""));
            Assert.IsTrue(html.Contains("class=\"grid-filter-btn\""));
            Assert.IsTrue(html.Contains("data-widgetdata="));
        }
 public QueryStringFilterColumnHeaderRenderer(QueryStringFilterSettings settings)
 {
     _settings = settings;
 }
Beispiel #3
0
 public QueryStringFilterColumnHeaderRenderer(QueryStringFilterSettings settings)
 {
     _settings = settings;
 }
 public QueryStringGridSettingsProvider()
 {
     _sortSettings = new QueryStringSortSettings();
     //add additional header renderer for filterable columns:
     _filterSettings = new QueryStringFilterSettings();
 }