public TestGridSpecWithNoTotalColumns() { ObjectNameSingular = "SOY"; ObjectNamePlural = "SOYs"; GridInstructionsWhenEmpty = "I am empty"; // Edit SOY Add(string.Empty, m => { // Edit button // ----------- var contentUrl = string.Format("{0}/EditAction/{1}", TestControllerName, m.PrimaryKey); var dialogTitle = string.Format("Edit this {0}", m.DisplayName); var dialogForm = new ModalDialogForm(contentUrl, 350, dialogTitle); return(DhtmlxGridHtmlHelpers.MakeEditIconAsModalDialogLinkBootstrap(dialogForm)); }, 35); // Delete SOY Add(string.Empty, m => { var contentUrl = string.Format("{0}/DeleteAction/{1}", TestControllerName, m.PrimaryKey); var deleteLink = DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(contentUrl, true); return(deleteLink); }, 35); Add("Display Name", m => m.DisplayName, 200); Add("Is Active", m => m.IsActive.ToYesNo(), 60, DhtmlxGridColumnFilterType.SelectFilterStrict); Add("Amount", m => m.Amount, 100, DhtmlxGridColumnFormatType.Currency); }
public void BuildGridColumnsTest() { const string indent = ""; var gridSpec = new TestGridSpec(); var result = DhtmlxGridHtmlHelpers.BuildGridColumns(gridSpec, indent); Approvals.Verify(result); }
public void VerifyJavascriptForDhtmlxGrid() { var gridSpec = new TestGridSpec(); const string gridName = "testGridName"; var testGridSpecClasses = new List <TestGridSpecClass>(); testGridSpecClasses.Add(new TestGridSpecClass(1, "One", true, 1000m)); testGridSpecClasses.Add(new TestGridSpecClass(2, "Two", true, 2000m)); testGridSpecClasses.Add(new TestGridSpecClass(3, "Three", false, 3000m)); testGridSpecClasses.Add(new TestGridSpecClass(4, "Four", true, 4000m)); testGridSpecClasses.Add(new TestGridSpecClass(5, "Five", false, 5000m)); testGridSpecClasses.Add(new TestGridSpecClass(6, "Six", true, 6000m)); var result = DhtmlxGridHtmlHelpers.DhtmlxGrid(gridSpec, gridName, string.Format("{0}/ListGridDataXml", TestControllerName), "height:250px;"); Approvals.Verify(result); }
public void IsUsingSmartRenderingWithColumnsThatHaveNoTotalsTest() { var gridSpec = new TestGridSpecWithNoTotalColumns(); Assert.That(DhtmlxGridHtmlHelpers.IsUsingSmartRendering(gridSpec), Is.True, "Should be using smart rendering because we have a grid spec that has a total column"); }