diff --git a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs index 1ccdb4d..4c5feaa 100644 --- a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs +++ b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs @@ -31,12 +31,13 @@ namespace EGFramework.UI EmptyData = typeof(T).EGenerateEmptyDictiontaryByType(); QueryPage.Register(() => QueryPageData()); TableName = typeof(T).Name; + TitleData = typeof(T).EGenerateDictiontaryByType(); InitFunctionMenu(); - InitTitle(typeof(T).EGenerateDictiontaryByType()); + InitTitle(TitleData); InitRowData(null); InitPageMenu(); } - + public void QueryPageData() where T : new() { @@ -91,7 +92,7 @@ namespace EGFramework.UI if (rowData.GetData().ContainsKey("Id")) primaryKey = "Id"; if (primaryKey == "") { - this.EGAlert("Parmary key 'id' not defined!","Error"); + this.EGAlert("Parmary key 'id' not defined!", "Error"); return; } int remove_count = SaveData.RemoveData(CurrentDataKey, rowData.GetData()[primaryKey]); @@ -103,5 +104,32 @@ namespace EGFramework.UI } //base.InitPageData(); } + + public override void ExecuteSearch() + { + RowDataContainer.ClearChildren(); + string fieldName = FieldSelect.Text; + string keyWords = SearchEdit.Text; + // List> SearchData = TableData.ESearchByKeyword(fieldName, keyWords); + // int dataPointer = 0; + // foreach (Dictionary searchrow in SearchData) + // { + // EGodotTableRowData rowData = RowDataContainer.CreateNode("row" + dataPointer); + // dataPointer++; + // rowData.Init(searchrow); + // rowData.OnModify.Register(data => + // { + // this.EGEditDialog(data, rowData.OnDataEdit, "Modify"); + // }); + // rowData.OnDelete.Register(() => + // { + // this.TableData.Remove(rowData.GetData()); + // PageAdapter.DataLength--; + // PageAdapter.Reload(PageAdapter.DataLength, PageLimit); + // InitPageData(); + // OnPageChanged.Invoke(); + // }); + // } + } } } \ No newline at end of file diff --git a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs index 887920c..488af25 100644 --- a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs +++ b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs @@ -96,10 +96,10 @@ namespace EGFramework.UI } - + protected OptionButton FieldSelect { set; get; } + protected LineEdit SearchEdit { set; get; } public virtual void InitFunctionMenu() { - if (FunctionContainer == null) { FunctionContainer = this.CreateNode("FunctionContainer"); @@ -119,7 +119,7 @@ namespace EGFramework.UI Button output = FunctionContainer.CreateNode