DextopJsBag GetListConfig() { var res = new DextopJsBag(); if (listWidth > 0) { res["width"] = listWidth; } if (listEmptyText != null) { res["emptyText"] = listEmptyText; } if (listItemTpl != null) { res["itemTpl"] = listItemTpl; } if (listLoadingText != null) { res["loadingText"] = listLoadingText; } if (listMaxWidth > 0) { res["maxWidth"] = listMaxWidth; } if (listMinWidth > 0) { res["minWidth"] = listMinWidth; } if (listResizable) { res["resizable"] = true; } return(res); }
/// <summary> /// Converts this attribute to the column object. /// </summary> /// <param name="memberName">Name of the member.</param> /// <param name="memberType">Type of the member.</param> /// <returns></returns> public override DextopGridColumn ToGridHeader(string memberName, Type memberType) { var res = base.ToGridHeader(memberName, memberType); res.type = "remote-lookup"; if (lookupId != null) { res["lookupId"] = lookupId; } if (valueNotFoundDataIndex != null) { res["valueNotFoundDataIndex"] = valueNotFoundDataIndex; } var fieldConfig = new DextopJsBag(); fieldConfig["valueField"] = valueField; if (displayField != null) { fieldConfig["displayField"] = displayField; } if (listWidth > 0) //list has custom width set { fieldConfig["matchFieldWidth"] = false; } var listConfig = GetListConfig(); if (!listConfig.IsEmpty()) { fieldConfig["listConfig"] = listConfig; } if (forceSelection) { fieldConfig["forceSelection"] = forceSelection; } if (hideTrigger) { fieldConfig["hideTrigger"] = hideTrigger; } res["field"] = fieldConfig; return(res); }
DextopJsBag GetListConfig() { var res = new DextopJsBag(); if (listWidth > 0) res["width"] = listWidth; if (listEmptyText != null) res["emptyText"] = listEmptyText; if (listItemTpl != null) res["itemTpl"] = listItemTpl; if (listLoadingText != null) res["loadingText"] = listLoadingText; if (listMaxWidth > 0) res["maxWidth"] = listMaxWidth; if (listMinWidth > 0) res["minWidth"] = listMinWidth; if (listResizable) res["resizable"] = true; return res; }
/// <summary> /// Converts this attribute to the column object. /// </summary> /// <param name="memberName">Name of the member.</param> /// <param name="memberType">Type of the member.</param> /// <returns></returns> public override DextopGridColumn ToGridHeader(string memberName, Type memberType) { var res = base.ToGridHeader(memberName, memberType); res.type = "remote-lookup"; if (lookupId != null) res["lookupId"] = lookupId; if (valueNotFoundDataIndex != null) res["valueNotFoundDataIndex"] = valueNotFoundDataIndex; var fieldConfig = new DextopJsBag(); fieldConfig["valueField"] = valueField; if (displayField != null) fieldConfig["displayField"] = displayField; if (listWidth>0) //list has custom width set fieldConfig["matchFieldWidth"] = false; var listConfig = GetListConfig(); if (!listConfig.IsEmpty()) fieldConfig["listConfig"] = listConfig; if (forceSelection) fieldConfig["forceSelection"] = forceSelection; if (hideTrigger) fieldConfig["hideTrigger"] = hideTrigger; res["field"] = fieldConfig; return res; }