Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[RELEASED] UI Table

Discussion in 'Assets and Asset Store' started by bourriquet, Mar 14, 2019.

  1. dave12490182401284

    dave12490182401284

    Joined:
    Aug 17, 2022
    Posts:
    5
    I am having a problem with the table not being updated when changing values of existing rows (update works when adding or removing rows).

    I've tried with both Run-time update on the contents turned on, or running `UpdateContent()` manually.

    The value being updated is a type `FixedString64Bytes`. But the table still shows the old text value; I've debugged and the collection itself is definitely being updated; but table is not picking up the change.

    What should I do?
     
  2. bourriquet

    bourriquet

    Joined:
    Jul 17, 2012
    Posts:
    181
    I cannot reproduce this in the example scene @zKici.
    Do you do something differently? What version of Unity do you use?
     
  3. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    Weird, I tried to reproduce with your example scene and could not.
    Unity 2020.3.25f1

    The setup is similar, with the exception I have all inputs as input expandable and scroll-able / select-able lines. Perhaps because some input fields are not more than default height and others are, so it gets confused?
    Here are screenshots before deleting a row:
    upload_2022-8-28_16-42-57.png
    after:
    upload_2022-8-28_16-43-29.png

    Note: it only makes them default row height from the deletion row below.

    If you have discord I can screenshare if that'll help narrow it down? Or anything else you need me to share to figure it out please let me know,
    Thanks
     
  4. bourriquet

    bourriquet

    Joined:
    Jul 17, 2012
    Posts:
    181
    If you can send me a package of your scene, or a minimal version to make the bug happen, I can have a look.
     
  5. bourriquet

    bourriquet

    Joined:
    Jul 17, 2012
    Posts:
    181
    @dave12490182401284 It seems to work normally on my end:
     
  6. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    It was mind boggling to narrow it down.. the bug shows up when there are different length of text input, sent you scene in PM.
    Select 2nd row, delete and you will see the bug.

    Thanks
     
  7. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    Thank you for resolving my issue, as per creator: The InputCellStyle object you're using for your columns is set to SingleLine. Changing it to MultiLine fixed it.

    Follow up question, how can I select/highlight a row by code?
     
  8. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    Asides from how to select/highlight a row by code

    When I open a prefab example: Input Cell - Expandable, I get constant errors:
    NullReferenceException: Object reference not set to an instance of an object
    UnityUITable.TableCell.get_container () (at Assets/RuntimeGUITable/Scripts/Cells/TableCell.cs:50)
    UnityUITable.TableCell.get_columnInfo () (at Assets/RuntimeGUITable/Scripts/Cells/TableCell.cs:71)
    UnityUITable.TableCell.Update () (at Assets/RuntimeGUITable/Scripts/Cells/TableCell.cs:146)
     
  9. Kalibyrx

    Kalibyrx

    Joined:
    Apr 28, 2022
    Posts:
    5
    @bourriquet Hello, I must say that you have a great product!

    I understand that this table was meant for data display purposes, but I was wondering if you could help me further customize this asset.

    I'm looking to try and instantiate each table cell container to also contain a single script.cs, and when selected, return which instance of the script.cs is called.

    Is this possible with how you've laid it all out? I know that selected elements returns the index int, which is awesome, but I couldn't figure out how to add an additional list of a C# class, List<Button> etc.

    Thanks!
     
  10. dave12490182401284

    dave12490182401284

    Joined:
    Aug 17, 2022
    Posts:
    5
    Is it possible to use this with TextMeshPro instead of Text component? The old `Text` component looks really pixelated compared to `TextMeshPro`

    Example (Left is TextMeshPro which I manually switched in Game scene; and right is the original Text component from the table):
     

    Attached Files:

  11. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    437
    Hello

    Can I please get some help with how to select a specific row's and column index by code so I can modify its properties such as highlighting them 'red'
     
  12. Jan85

    Jan85

    Joined:
    Aug 18, 2013
    Posts:
    3
    Hello,
    After updating the UI Table to the latest version 1.19, I can no longer use Table.SelectedRow. I need to capture which row is selected at runtime. Is there some new way how to do it in this version?
    Thank you
     
  13. unity_0A7E9251F7B47DF35F4A

    unity_0A7E9251F7B47DF35F4A

    Joined:
    Nov 14, 2022
    Posts:
    1
    Hi,

    I would like to use a ScriptableObject instead of a GameObject for the collection? However I figured out that this is not an easy task.

    Or is it possible to set the collection via script? This could also help.

    Are there any future plans for this?

    Thanks.

    Ben
     
  14. Mibutec

    Mibutec

    Joined:
    Jul 30, 2021
    Posts:
    6
    I face an issue the table is only getting updated when the row number changes. Here's how I create the data:

    Code (CSharp):
    1.  public class DashboardDataObject : ImprovedMonoBehaviour {
    2.         public List<QuestDto> quests = new List<QuestDto>();
    3.  
    4.         public DashboardDataObject() {
    5.             quests.Add(new QuestDto("title1", "desc1"));
    6.             quests.Add(new QuestDto("title2", "desc2"));
    7.         }
    8.  
    9.         void Update() {
    10.             quests = new List<QuestDto>();
    11.             quests.AddRange(createQuestData());
    12.         }
    13.     }
    14.  
    15.     [System.Serializable]
    16.     public class QuestDto {
    17.         public string title { get; private set; }
    18.         public string description { get; private set; }
    19.  
    20.         public QuestDto(string title, string description) {
    21.             this.title = title;
    22.             this.description = description;
    23.         }
    24.  
    25.         public override string ToString() {
    26.             return description;
    27.         }
    28.     }
    When just the title or description of a quest change, the change is not visible in the table. Only when I do something changing the no of items an update happens. Is this a bug, or am I doing something wrong?

    For now I helped myself by changing in Table.cs, but guess this cannot be the solution

    Code (CSharp):
    1.  public void UpdateContent()
    2.         {
    3.             if (currentState != State.Valid)
    4.                 return;
    5.             targetCollection.UpdateCache();
    6.             int titleRows = (hasTitles ? 1 : 0);
    7.             int expectedNbRows = ActualElementCount;
    8.             int actualNbRows = tableRows.Count - titleRows;
    9. //            if (actualNbRows != expectedNbRows)          <--- my change
    10.             {
    11.                 UpdateSortedElements();
    12.                 UpdateRows(expectedNbRows, actualNbRows, titleRows);
    13.             }
    14.  
    15.             foreach (TableRow row in tableRows)
    16.                 row.UpdateContent();
    17.         }
    It's the version I bought 2 weeks ago, so guess it's 1.19
     
    sirshelley likes this.
  15. visualjump3d

    visualjump3d

    Joined:
    Jun 6, 2014
    Posts:
    14
    Hi , I just bought your plugin , I wanted to ask you some questions :

    Is it possible to add ComboBox as well?
    Is it possible to add a row immediately after the selected one?