Ejemplo n.º 1
0
        /// <summary>
        /// Renders the a grid partial view which is just the grid data portion.
        /// </summary>
        /// <param name="module">The module on behalf of which the grid data portion is rendered.</param>
        /// <param name="model">The model being rendered by the grid data portion.</param>
        /// <returns>The HTML representing the grid data portion.</returns>
        public async Task <string> RenderViewAsync(ModuleDefinition module, GridPartialData model)
        {
            // save settings
            await GridLoadSave.SaveSettingsAsync(model);

            // handle async properties
            await HandlePropertiesAsync(model.Data.Data);

            HtmlBuilder hb = new HtmlBuilder();

            hb.Append(await HtmlHelper.ForDisplayContainerAsync(model, "GridPartialData"));

            return(hb.ToString());
        }
Ejemplo n.º 2
0
 public ActionResult GridSaveColumnWidths(Guid settingsModuleGuid, Dictionary <string, int> columns)
 {
     GridLoadSave.GridSavedSettings gridSavedSettings = GridLoadSave.LoadModuleSettings(settingsModuleGuid);
     foreach (var col in columns)
     {
         if (gridSavedSettings.Columns.ContainsKey(col.Key))
         {
             gridSavedSettings.Columns[col.Key].Width = col.Value;
         }
         else
         {
             gridSavedSettings.Columns.Add(col.Key, new GridDefinition.ColumnInfo()
             {
                 Width = col.Value
             });
         }
     }
     GridLoadSave.SaveModuleSettings(settingsModuleGuid, gridSavedSettings);
     return(new EmptyResult());
 }