public void RowDelete(UI_Control_Table_Row row) { if(RowDeleteEvent!=null) { RowDeleteEvent(row); } }
public void Init(UI_Control_Table_Row _row, CallBack<string, int> Click) { row = _row; if(Btn!=null) { Btn.onClick.RemoveAllListeners(); Btn.onClick.AddListener(() => { Click(value, row.index); }); } }
/// <summary> /// 删除一行 /// </summary> /// <param name="row"></param> public void RemoveRow(UI_Control_Table_Row row) { Rows.Remove(row); Destroy(row.gameObject); RectTransform rtf = RowParents.GetComponent<RectTransform>(); rtf.sizeDelta = new Vector2(rtf.sizeDelta.x, Rows.Count * RowHeight); for (int i = 0; i < Rows.Count; i++) { RectTransform rt = Rows[i].gameObject.GetComponent<RectTransform>(); rt.anchoredPosition3D = new Vector3(0, i * RowHeight * -1, 0); Rows[i].SetColor(i % 2 == 0 ? UI_Manager.Instance.NormalColor1 : UI_Manager.Instance.NormalColor2); } }
void Datas_Recv_RowDeleteEvent(UI_Control_Table_Row row) { int k = App.Instance.data.connection.Execute(string.Format("delete from GPSendRecv where SeqID='{0}'", row.datas["seqid"])); if (k > 0) { Datas_Recv.RemoveRow(row); } else { MessageBox.Instance.ShowType1("提示信息", "删除失败", true, null); } }