private static void AssignNestedWidgetBuilderID(ComponentID id, IDictionary <string, object> options) { if (id.IsAssigned) { if (!options.ContainsKey("elementAttr")) { options["elementAttr"] = new Dictionary <string, object>(); } (options["elementAttr"] as Dictionary <string, object>)["id"] = id.ToJS(); } }
public void RenderWithUnderscore(StringBuilder builder) { string validationConfig = GetValidationConfig(); string arg = ElementID.IsAssigned ? JsonUtils.SafeSerialize(ElementID.ToJS()) : "\"dx-\" + new DevExpress.data.Guid()"; string arg2 = JsonUtils.SafeSerialize(PluginName); string arg3 = JsonUtils.SafeSerialize(Options); builder.Append("<%!function(){%>").AppendFormat("<div id=\"<%=arguments[0]%>\">{0}</div>", TranscludedContent).AppendFormat("<%DevExpress.aspnet.createComponent({0},{1},arguments[0]", arg2, arg3); if (!string.IsNullOrEmpty(validationConfig)) { builder.AppendFormat(",{0}", validationConfig); } builder.AppendFormat(")%><%}}({0})%>", arg); }