public TransactionDetailsRow AddRow() { TransactionDetailsRow row = Instantiate(transactionDetailsRowPrefab, contentPanel.transform); row.transform.SetAsLastSibling(); contentList.Add(row); ResetAllRows(); return(row); }
public void displayTransactionDetails(bool isAlreadyExpanded, string selectedPanelKey) { transactionDetailsList.RemoveAllRows(); TransactionDetailsRow row = transactionDetailsList.AddRow(); TransactionSummaryGameObjectList transactionGameObjects = null; row.InitiateTransactionDetailsRow(selectedMainPanelKey); transactionGameObjectDict = row.expandCollapseTransactionDetailsRows(selectedMainPanelSubDetailsData, selectedMainPanelKey, true, transactionGameObjectDict); transactionGameObjects = transactionGameObjectDict[selectedMainPanelKey]; GameObject transactionDetailsParentPanel = transactionGameObjects.GetParentGameObject(); foreach (TransactionSummaryDetailsData tsDetailsData in selectedMainPanelSubDetailsData.getTransactionSummaryDetailsData()) { string currentTransactionDetailsPanelkey = selectedMainPanelKey + "_" + tsDetailsData.GetPrimaryKey(); bool curTransactionPanelExpandedFlag = false; if ((currentTransactionDetailsPanelkey).Equals(selectedPanelKey)) { curTransactionPanelExpandedFlag = !isAlreadyExpanded; } else { if (transactionGameObjectDict.ContainsKey(currentTransactionDetailsPanelkey)) { transactionGameObjects = transactionGameObjectDict[currentTransactionDetailsPanelkey]; curTransactionPanelExpandedFlag = transactionGameObjects.IsExpanded(); if (curTransactionPanelExpandedFlag) { //transactionGameObjectDict = row.ExpandCollapseThirdPanel(curFinalPanelExpandedFlag, tsSubDetailsData, currentSecondSubPanelkey, transactionGameObjectDict); } } } GameObject transactionDetailsPanel = transactionDetailsParentPanel.transform.Find("TransactionsPanel_" + currentTransactionDetailsPanelkey).gameObject; //transactionDetailsPanel.GetComponentsInChildren<Button>()[0].onClick.AddListener(() => displayTransactionDetails(curTransactionPanelExpandedFlag, currentTransactionDetailsPanelkey)); transactionDetailsPanel.GetComponentsInChildren <Button>()[0].onClick.AddListener(() => openTransactionReceipt(tsDetailsData)); } }