Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions dotnet/src/dotnetframework/GxClasses/Core/Web/HttpAjaxContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public interface IHttpAjaxContext
void ajax_rsp_assign_hidden_sdt(String SdtName, Object SdtObj);
void ajax_rsp_assign_prop(String CmpPrefix, bool IsMasterPage, String Control, String Property, String Value, bool sendAjax);
void ajax_rsp_assign_uc_prop(String CmpPrefix, bool IsMasterPage, String Control, String Property, String Value);
void ajax_rsp_assign_grid(String ControlName, Object GridObj);
#pragma warning disable CA1707 // Identifiers should not contain underscores
void ajax_rsp_assign_grid(String ControlName, Object GridObj, String Control);
void ajax_rsp_assign_grid(String ControlName, Object GridObj);
#pragma warning restore CA1707 // Identifiers should not contain underscores
void AddStylesheetToLoad(String url);
void AddStylesHidden();
void ajax_rsp_clear();
Expand Down Expand Up @@ -72,6 +75,7 @@ public class HttpAjaxContext : IHttpAjaxContext
private Hashtable _LoadCommands = new Hashtable();
private JObject _Messages = new JObject();
private JArray _Grids = new JArray();
private Dictionary<String, int> DicGrids = new Dictionary<String, int>();
private JObject _ComponentObjects = new JObject();
private JArray _StylesheetsToLoad = new JArray();
private NameValueCollection _formVars;
Expand Down Expand Up @@ -447,12 +451,31 @@ public void ajax_rsp_assign_uc_prop(String CmpContext, bool IsMasterPage, String
}
}

public void ajax_rsp_assign_grid(String GridName, Object GridObj)
public void ajax_rsp_assign_grid(String ControlName, Object GridObj) {
try
{
Grids.Add(((IGxJSONAble)GridObj).GetJSONObject());
}
catch (Exception ex)
{
GXLogging.Error(log, "ajax_rsp_assign_grid error", ex);
}
}

public void ajax_rsp_assign_grid(String GridName, Object GridObj, String Control)
{
try
{
Grids.Add(((IGxJSONAble)GridObj).GetJSONObject());
}
if (DicGrids.ContainsKey(Control))
{
Grids[DicGrids[Control]] = ((IGxJSONAble)GridObj).GetJSONObject();
}
else
{
Grids.Add(((IGxJSONAble)GridObj).GetJSONObject());
DicGrids.Add(Control, Grids.Length - 1);
}
}
catch (Exception ex)
{
GXLogging.Error(log, "ajax_rsp_assign_grid error", ex);
Expand Down