Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Table Pro: When Your Data isn't a Game

Discussion in 'Assets and Asset Store' started by slumtrimpet, Aug 15, 2015.

  1. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Need to display data in a list or table format in Unity UI?


    We think we offer the simplest and best-performing solution on the Asset Store to satisfy all your table rendering needs!

    What sets us apart from other solutions is that all you need to do is attach our script to a RectTransform and use our simple API to populate your data. We'll then render a completely style-able table for you in real-time and without any kludgy prefab requirements.

    Check out just how simple our "Basic Usage" document here:
    https://docs.google.com/document/d/1DO4cXgBbY76HCWjzqC169os8RzeDVcCu4Ruu12vPEP8

    Or... view us directly on the Asset Store here (including several demos in both WebPlayer and WebGL formats):
    http://u3d.as/ipR

    Let us know what you think or if you find any issues! We've tried the other Unity UI Table solutions... and that's why decided to write ours. We think it's the best offering on the market and we hope you do too.

    High-Level Features:
    • NO PREFABS! Our engine renders your data. Period.
    • Display multiple-line and dynamic height data rows.
    • Rows and columns automatically resize to fit your data.
    • Columns can contain either Text or Sprite cells.
    • Display dynamic column headers and footers that remain visible and also auto-size for your data.
    • Intelligently renders a minimal amount of actual UI elements at any time. Never renders your entire dataset.
    Release Notes 1.31 (2019.06.03)
    • BUG: Fixing issues in ScreensSpace Camera Canvas render
    • ENHANCEMENT: Adding and documenting new table event callbacks
    • ENHANCEMENT: Added shift+click multi-select mimicking Windows behavior
    Release Notes 1.30 (2019.02.12)
    • BUG: Scrollbars now no longer have the unnecessary indentation
    • BUG: Now properly stopping coroutines via handle instead of by name
    Release Notes 1.29 (2019.02.07)
    • BUG: Now properly using default text shader in modern Unity revs
    Release Notes 1.28 (2019.01.21)
    • ENHANCEMENT: Auto scroll to rows performs much better on large datasets
    • ENHANCEMENT: 2019 code style update
    Release Notes 1.27 (2018.10.30)
    • BUG: Input cell behavior adjusted on single-input rows
    • BUG: Performance increased on non-pixel-perfect canvas
    Release Notes 1.26 (2018.07.03)
    • ENHANCEMENT: Setting RayCast interception properties only where needed
    • ENHANCEMENT: New 'constant' Multi-Select mode (no shift-key press req)
    • ENHANCEMENT: Unity Text will now use a default material
    • BUG: Multi-Cell-Selection can now properly deselect cells
    • BUG: Table animations now work properly on WebGL builds again
    Release Notes 1.25 (2018.05.31)
    • ENHANCEMENT: Can now populate datum elements in secondary threads!
    • BUG: Scrollbars now inherit canvas scale factor properly
    Release Notes 1.24 (2018.03.29)
    • BUG: TablePro now works with Unity >= 2017.3!
    • INFO: Minimum supported Unity rev increased from 5.5.0 to 5.5.5p2
    Release Notes 1.23 (2018.01.04)
    • ENHANCEMENT: 'long-tap' event performance improvement [using invoke instead of Update()]
    • ENHANCEMENT: Now support cell deselect callbacks [Table.SetDeselected()]
    • ENHANCEMENT: Now support configurable multi-select key (control/shift)
    • BUG: Fixed rare issue with TMPro Input Cell positioning
    • BUG: Changed Row click handler to trigger Cell-level clicks in all cases
    Release Notes 1.22 (2017.10.25):
    • ENHANCEMENT: Now support a 'long-tap' event on cells.
    • ENHANCEMENT: Now support selection modes: MULTICELL and MULTIROW
    • ENHANCEMENT: Globally applied uncrustify code style
    • BUG: Fixed rare issue related to alpha colors and header cells
    • BUG: Input cells now reset properly when the table is redrawn in change handler
    • BUG: Input cells now position properly in 2017.1
    Release Notes 1.21 (2017.07.05):
    • ENHANCEMENT: added ability to disable row hover colors
    • BUG: Input cells + programmatically animated scrolling now work together
    Release Notes 1.20 (2017.04.20):
    • ENHANCEMENT: now supports TextMeshPro text! (http://u3d.as/L38 or Pro version >= 1.0.55.56.0b8)
    • ENHANCEMENT: added UID based indexof method on datum object
    • ENHANCEMENT: can now define scrollbar 'thumb' size
    • ENHANCEMENT: new can define default font and style for all tables in Singleton
    • BUG: Patched vertical row spacing issue
    • BUG: TablePro will now throw a WARNING when StartRenderEngine called on an inactive table
    • BUG: Fixes for row selection hover issues
    • BUG: Fixed rare error when rendering header cells
    Release Notes 1.19 (2017.02.10):
    • BUG: Correcting rare issues around multi-line data in single-row tables
    • BUG: Correcting issues with using keyboard nav with input field heavy tables
    Release Notes 1.18 (2017.01.13):
    • ENHANCEMENT: now support adding integer elements directly (no stringing needed)
    ReleaseNotes 1.17 (2016.12.23):
    • BUG: Fixed issue with scrollbar visibility in Unity5.5+
    Release Notes 1.16 (2016.12.19):
    • BUG: Correct gizmo display for ScreenSpaceOverlay/Camera
    • BUG: Setting transform parent properly on input widget
    • ENHANCEMENT: Rows now have a definable "NormalAltColor"
    Release Notes 1.15 (2016.10.19):
    • BUG: Will now color rows properly on mouse-over on touch devices
    • BUG: Will handle resize when set to force 100% width
    Release Notes 1.14 (2016.10.19):
    • BUG: Fixed issue with table redrawing in draggable parent rect
    • BUG: Fixed issue applying table formatting after a redraw
    • ENHANCEMENT: Code Formatting Updates
    Release Notes 1.13 (2016.10.13):
    • ENHANCEMENT: Multiple bug fixes and enhancements per awesome user feedback!
    Release Notes 1.12 (2016.09.19):
    • BUG: Corrected cell coloring issue when deactivating and activating a table
    • ENHANCEMENT: Will now auto-scroll when using the MoveSelectionUp/MoveSelectionDown methods
    • ENHANCEMENT: Added new"GeneralSettings" called "TableSelectionUIMode" this can be used to disable cell-level UI highlighting on interaction
     
    Last edited: Jun 3, 2019
    User340 likes this.
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    What is the drawcall for table like this?
     
  3. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    The table in the gif is about the toughest case and it's 19 draws.

     
  4. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    That's abit high. So it is animated? Since u are drawing them manually, I suppose you can batch them, no?
     
  5. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    It runs ok on an iPad2 as is, but you make a good point. We'll look into optimizing that bit and I'll post back when it's better. Thanks for the input!
     
  6. MikaelTroc

    MikaelTroc

    Joined:
    Nov 2, 2012
    Posts:
    33
    Is it possible to use buttons in the table in some way ?
     
  7. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Right now we've got callbacks on click of rows and individual column headers (to facilitate custom sort implementations). The row's themselves render mouse hover/down/selected states... so they behave kind of like buttons but we aren't using the actual button script on them. So.. not sure if that's what you are asking about with regard to buttons, but yes, the table is fully mouse-interactable liked you'd expect.
     
  8. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Still looking into this, but it appears the general consensus on this is that this is just the nature of the new Unity UI. There's no way to NOT create at least two draw calls per mask and Unity text pretty much doesn't batch at all so the Unity UI gets to a mid-teens level of draw calls pretty quickly as soon as you get any sort of non-trivial UI layout in play.

    It doesn't appear there's any obvious quick hit to reduce draw calls as that's just the limitation of thew new Unity UI.... the new Unity UI sure doesn't compete with NGUI at all when looking purely at draw call optimization. :)
     
    imtrobin likes this.
  9. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    On a whim, I grabbed the beta release of Unity 5.2.0f1.

    Swapping all my Mask elements for the new RectMask2D object that's added in 5.2.0 makes the scene 'only' take 15 draws now. So.. that's a bit better. I'll make sure I add that into the next release so if you are using 5.2.0 (when it comes out) it'll use the newer mask method.
     
  10. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Quick update... we did manage to find some areas where we were able to remove some UI element overlaying and trim off some drawcalls. The test scene above now runs with 13 draw calls in Unity 5.0-5.1 (and fewer in 5.2 with the new masking enabled). This performance improvement will be included in our next update.
     
    Last edited: Aug 18, 2015
    imtrobin likes this.
  11. greay

    greay

    Joined:
    Mar 23, 2011
    Posts:
    88
    This is pretty great. It's helped a lot so far.

    One issue:

    - the reset() method doesn't really, and leaves the table in a sorta weird state. So you can't reuse the same table to show different data (things like renaming headers or changing the # of columns does not work).

    A few requests, in order of preference:

    - I'd really like to be able to disable horizontal scrolling, and have the text labels expand to wrap to 1+ lines.
    - Since you're not using buttons, we don't get keyboard/controller navigation for free from the event system. I was able to write my own, but this makes the selection callback useless (there's no way I can see to highlight a row, only select it)
    - Finally, I don't have a need for this now, but it would be useful to be able to supply something other that a string or an image for a cell.
     
  12. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Thanks for the feedback!

    Regarding the reset() issues, that's actually fixed in version 1.3 (or should be) and has already been submitted to Unity for approval (yesterday). Should hit the store early next week. Please definitely hit us up once 1.3 hits if you still have issues with that.

    Regarding request one, if I'm understanding correctly, you should be able to click the Restrict 100% Width Max toggle under the inspector "General" settings. Let us know if that doesn't provide the feature as you describe.

    And finally, regarding your event and custom game objects requests... sound like reasonable ideas and we'll put them on the list. The keyboard nav actually may be sooner than later so we'll ping back here with an update when available.
     
  13. greay

    greay

    Joined:
    Mar 23, 2011
    Posts:
    88
    Excellent, thanks! I'll definitely be looking forward to 1.3 (and beyond).

    Yes, the Restrict 100% Width Max setting was what I wanted. Only... I do seem to be having trouble with it. My table's width is 795. But all the rows are 100 px wider – I've dug in a little bit & gotten as far as seeing that the table's (hidden) tableRect property's width is 895, but I'm still trying to figure out why.
     
  14. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Oh man, you're not going to believe this, but that exact bug is also fixed in 1.3 as well. :)
     
    greay likes this.
  15. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
  16. greay

    greay

    Joined:
    Mar 23, 2011
    Posts:
    88
    Thanks for the update! It did fix my second issue (I reworked my setup so it creates new tables each time, so I haven't tested the reset() change).

    I have 2 new bugs to report, though:

    1. the calculation for the minimum height of the table is off; it doesn't take into account the minimum row size. I don't know if this is the best place for it, but I changed Datum.cs:186 to:

    Code (CSharp):
    1. if (this._measuredHeight.Value > this.table.minRowHeight) return this._measuredHeight.Value;
    2. else return this.table.minRowHeight;
    3.  
    2. This was present in the last version, but I held off reporting it in case it was already fixed. Sometimes, when creating a table with one column & no headers, the table will be laid out & then immediately disappear. I'm really not sure what's causing this, though digging through the hierarchy I can still see the rows and everything looks right. The text just isn't visible.
     
    slumtrimpet likes this.
  17. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    I think you are spot on regarding the minRowHeight logic and incorporated your fix in the trunk code. I'll run it through some more tests but I think you squished a legitimate bug there. Thanks!

    Regarding the disappearing table you mention in #2... I'm not able to duplicate that one but I'll keep poking at it. Is there any other info you can provide to help me reproduce that one on my side? Is the table on a screen space overlay canvas or one of the other variants? Anything particularly odd that you can think of? Definitely sounds like a nasty bug and I want to get it corrected.
     
  18. greay

    greay

    Joined:
    Mar 23, 2011
    Posts:
    88
    Sorry, I had company this week so wasn't able to look into this until today.

    I've gone to the trouble of creating 2 identical tables, one with headers & one without, and the first one displays fine while the second flashes & then disappears. But going back & forth through the hierarchy & comparing them, they're virtually identical (the Body's top position is slightly lower on the one w/the header). But everything's there in the one that's broken – if I dig down to the "0Text" component, I can see that the text is still there. And if I disable the mask on the Body object, everything becomes visible. So it's gotta be something going wrong with the Image Mask, but that's about all I've been able to figure out so far.
     
  19. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Thanks for your work on this man. I'm planning to sink some TablePro time in this week and will do my very best to try and duplicate/fix this issue.
     
    greay likes this.
  20. WuWanjia

    WuWanjia

    Joined:
    Nov 18, 2015
    Posts:
    6
    error:
    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[SLS.Widgets.Table.Column].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    SLS.Widgets.Table.MeasureMaster.doMeasure (SLS.Widgets.Table.Datum d) (at Assets/SLS/Widgets/Table/MeasureMaster.cs:24)
    SLS.Widgets.Table.Row.refresh () (at Assets/SLS/Widgets/Table/Row.cs:105)
    SLS.Widgets.Table.Datum.set_isDirty (Boolean value) (at Assets/SLS/Widgets/Table/Datum.cs:103)
    SLS.Widgets.Table.Element.set_value (System.String value) (at Assets/SLS/Widgets/Table/Datum.cs:19)
    SLS.Widgets.Table.Element..ctor (SLS.Widgets.Table.Datum d, System.String value) (at Assets/SLS/Widgets/Table/Datum.cs:37)
    SLS.Widgets.Table.DatumElementList.Add () (at Assets/SLS/Widgets/Table/Datum.cs:253)
    SLS.Widgets.Table.Table.addTextColumn (System.String header, System.String footer, Single minWidth, Single maxWidth) (at Assets/SLS/Widgets/Table/Table.cs:183)
    showTable.reFlash () (at Assets/scene_Start/showTable.cs:54)
    UnityEngine.GameObject:SendMessage(String)
    loadJson:On_Click() (at Assets/scene_Start/loadJson.cs:29)
    UnityEngine.EventSystems.EventSystem:Update()

    I am a beginner...
     
  21. WuWanjia

    WuWanjia

    Joined:
    Nov 18, 2015
    Posts:
    6
    LOAD button code:


    using UnityEngine;
    using System.Collections;
    using LitJson;
    using System.IO;
    using UnityEngine.UI;
    public class loadJson : MonoBehaviour {
    private int n;
    private GameObject ob;
    public void On_Click()
    {

    JsonData jd = JsonMapper.ToObject(File.ReadAllText("E:" + "/" + "json.json"));
    //Debug.Log(((string)jd["0"]["ID"]));
    n = (int)jd["ID"];
    PlayerPrefs.SetInt("ID", n);
    for (int i = 0; i <= n - 1; i++)
    {
    string a = i.ToString();
    PlayerPrefs.SetInt("C" + a + "Id", i);
    PlayerPrefs.SetString("C" + a + "XinHao", (string)jd[i.ToString()]["XinHao"]);
    PlayerPrefs.SetString("C" + a + "BuMen", (string)jd[i.ToString()]["BuMen"]);
    PlayerPrefs.SetString("C" + a + "ShiYongRen", (string)jd[i.ToString()]["ShiYongRen"]);
    PlayerPrefs.SetString("C" + a + "IP", (string)jd[i.ToString()]["IP"]);
    PlayerPrefs.SetString("C" + a + "BianHao", (string)jd[i.ToString()]["BianHao"]);
    PlayerPrefs.SetString("C" + a + "BeiZhu", (string)jd[i.ToString()]["BeiZhu"]);
    }
    PlayerPrefs.Save();
    ob = GameObject.Find("Table");
    ob.SendMessage("reFlash");
    }

    }



    TABLE CODE:


    using UnityEngine;
    using System.Collections;
    using SLS.Widgets.Table;
    public class showTable : MonoBehaviour {

    public Table table;
    private int n;
    private int renderNumber;//渲染开关
    void Start () {
    this.table.reset();

    this.table.addTextColumn("序号");
    this.table.addTextColumn("型号");
    this.table.addTextColumn("部门");
    this.table.addTextColumn("使用人");
    this.table.addTextColumn("IP");
    this.table.addTextColumn("资产编号");
    this.table.addTextColumn("备注");
    this.table.initialize();
    n = PlayerPrefs.GetInt("ID");
    renderNumber = 0;
    for (int i = 0; i <= n - 1; i++)
    {
    if (PlayerPrefs.GetString("C" + i.ToString() + "XinHao") == "")
    {

    }
    else
    {
    Datum d = Datum.Body(i.ToString());
    d.elements.Add((i + 1).ToString());
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "XinHao"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BuMen"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "ShiYongRen"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "IP"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BianHao"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BeiZhu"));

    this.table.data.Add(d);
    renderNumber = 1;
    }
    }
    if (renderNumber == 1)
    {
    this.table.startRenderEngine();
    }

    }

    public void reFlash()
    {
    this.table.reset();

    this.table.addTextColumn("序号");
    this.table.addTextColumn("型号");
    this.table.addTextColumn("部门");
    this.table.addTextColumn("使用人");
    this.table.addTextColumn("IP");
    this.table.addTextColumn("资产编号");
    this.table.addTextColumn("备注");
    this.table.initialize();
    n = PlayerPrefs.GetInt("ID");
    renderNumber = 0;
    for (int i = 0; i <= n - 1; i++)
    {
    if (PlayerPrefs.GetString("C" + i.ToString() + "XinHao") == "")
    {

    }
    else
    {
    Datum d = Datum.Body(i.ToString());
    d.elements.Add((i + 1).ToString());
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "XinHao"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BuMen"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "ShiYongRen"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "IP"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BianHao"));
    d.elements.Add(PlayerPrefs.GetString("C" + i.ToString() + "BeiZhu"));

    this.table.data.Add(d);
    renderNumber = 1;
    }
    }
    if (renderNumber == 1)
    {
    this.table.startRenderEngine();
    }

    }
    }


    thank you !!!
     
  22. WuWanjia

    WuWanjia

    Joined:
    Nov 18, 2015
    Posts:
    6
    when i click the load button
    if the procedure's data is null--->error
    if not----> no error

    very strange...


    this table software is very cool, i like it!!!
    help me to find out the little BUG,thank you very much indeed!!!
    i am a rookie...
     
  23. patman

    patman

    Joined:
    Jul 4, 2012
    Posts:
    8
    I have found Table Pro to be very useful.

    I had a small difficulty that required me to alter your code. I allow users to edit a table. When they click on a row an editor pops up, populated with values from the Datum. After they edit values they can click Apply and the changes happen in the row and the editor disappears. However if they click the same row again nothing happens, because the headerClickCallback is not called if the row is already selected. I altered your code to allow the callback to happen, which works fine for me, but it would be even better if you included an option to select that behavior, so I don't have to alter the code each time you issue an update. If I'm the only one who cares about this, never mind.

    The relevant code:
    Code (CSharp):
    1.  
    2.         /*    old version
    3.       if (this._selectedDatum == value) return;
    4.       Row otherRow = this.getRowForDatum(this._selectedDatum);
    5.       this._selectedDatum = value;
    6.       if (otherRow != null)
    7.         otherRow.setColor();
    8.       if (this.selectionCallback != null)
    9.         this.selectionCallback(this._selectedDatum);
    10.         */
    11.         if (this._selectedDatum != value)
    12.         {
    13.             Row otherRow = this.getRowForDatum(this._selectedDatum);
    14.             this._selectedDatum = value;
    15.             if (otherRow != null)
    16.                 otherRow.setColor();
    17.         }
    18.         if (this.selectionCallback != null)
    19.             this.selectionCallback(this._selectedDatum);
    20.         }
    21.  
     
  24. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Hi there, it appears you found a legitimate bug here. None of our users have hit the use-case where you declare and initialize a table but don't actually call it's startRenderEngine() before re-initializing later (I think that's what's happening per your comment that you get an error when data is null).

    In Datum.cs please update line 97 from:

    Code (csharp):
    1.  
    2.       if (this._isDirty && this.table != null && this.table.data != null) {
    3.  
    To:

    Code (csharp):
    1.  
    2.       if (this._isDirty && this.table != null && this.table.isRunning && this.table.data != null) {
    3.  
    This update will be include in the next build. Thanks for the feedback and please don't hesitate to reply if this still doesn't resolve your issue!
     
  25. patman

    patman

    Joined:
    Jul 4, 2012
    Posts:
    8
    I use a File Chooser from the Asset Store to select a file. There is a callback function that is run when the file is selected, and in that function I read the file and construct a Table Pro table and call startRenderEngine. At the time the table is created, the panel in which it is rendered is not active. Later, when the user requests it, the panel is activated. The table does not show up, though, until the panel is clicked on. I'm assuming this is because the panel was inactive when startRenderEngine was invoked. (If the panel is active, the table shows immediately.) Do I have to wait until the panel is active to call startRenderEngine or is there another way to trigger it besides clicking the panel?
     
  26. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Seems reasonable. :) I've added it to our code-base and will run through some tests, but assume it will be included in the next update unless I reply back again here first. Thanks for the input!
     
  27. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    We do use coroutines for various pieces of the render engine (because some pieces are dependent on others so occasionally we need to delay stuff until later frames) so it's quite possible that calling 'startRenderEngine' when the GameObject is inactive would cause odd behavior.

    Can you call 'startRenderEngine' after you activate the parent GameObject and see if that behaves better for you?
     
  28. WuWanjia

    WuWanjia

    Joined:
    Nov 18, 2015
    Posts:
    6
    Can I update the table data? = =*
     
  29. WuWanjia

    WuWanjia

    Joined:
    Nov 18, 2015
    Posts:
    6


    Thank you !!!!!!!!!!!!!!!!!!!!!!!!!!!! NO BUG NOW!!!!!!!!!!!!!!!!!!!!!!
     
  30. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Yeah, just update table.data like a normal list. The updates should reflect in the render automagically.
     
  31. patman

    patman

    Joined:
    Jul 4, 2012
    Posts:
    8
    Yes, I have implemented a workaround where I save a state variable indicating whether the render engine has been started yet, and based on this I can delay calling startRenderEngine until the panel is activated. This works.
     
    slumtrimpet likes this.
  32. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    FYI to those that have asked via email and PM's for this....

    New version of TablePro was just submitted to the Asset Store with our two most frequently requested features:
    1. Individually selectable cells (previously you could only select rows)
    2. New "Input" cell type available that lets you enter text directly into your table like a spreadsheet.
    This is included in version 1.6 which will hopefully be approved and available within a week. See the GIF in the post at the top of this thread for a quick demo.

    Thanks!
     
  33. moheji

    moheji

    Joined:
    Aug 22, 2012
    Posts:
    5
    Samples -> DataTable.unity -> Play

    StackOverflowException
    UnityEngine.TextGenerator.Populate_Internal_cpp (System.String str, UnityEngine.Font font, Color color, Int32 fontSize, Single scaleFactor, Single lineSpacing, FontStyle style, Boolean richText, Boolean resizeTextForBestFit, Int32 resizeTextMinSize, Int32 resizeTextMaxSize, Int32 verticalOverFlow, Int32 horizontalOverflow, Boolean updateBounds, TextAnchor anchor, Single extentsX, Single extentsY, Single pivotX, Single pivotY, Boolean generateOutOfBounds)

    OSX10.11 , Unity 5.2.3p1 , Build Setting : Android

    not support Mobile?
     
  34. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    No... mobile is supported. The above works for me on exact same settings and OS (except I'm on Unity 5.2.3f1 instead of p1). I'll pull p1, but in the meantime can you paste the entire error stack? Not sure why the UnityEngine TextGenerator would be overflowing but I'd like to see at what point in our code it's being called.
     
  35. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I kept having an issue with scroll bars not appearing on my tables. After a few head banging hours I tracked the issue to the scrollbar "SlidingArea" and "Handle" objects being created with scale set to "0,0,0", which was making them seem to not appear.

    Adding the following line to Factory.cs in two places, after the block of code creating the SlidingArea object and then after the Handle object appears to have fixed the issue. I'm not sure why this was needed.

    go.transform.localScale += new Vector3(1f, 1f, 1f);

    Running Unity5.2.3f1 on Windows 10.
     
  36. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Thanks for the feedback on this one and thanks for the time you spent banging your head on it. Haven't seen that issue before but we'll roll your update into base release and test on other unity revs and platforms to make sure all is still happy with that change. Again... really appreciate the feedback and good luck to you.
     
  37. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Thanks for the response. After thinking about it, I should have used = instead of += in the line I listed by the way.
     
  38. Zuicis

    Zuicis

    Joined:
    Mar 14, 2014
    Posts:
    12
    Hi,
    Found 2 bugs? (version - latest):
    a) can't set transparent background of table body (table header transparency work's normaly)
    b) can't hide normaly a header row. If I leave empty header , then `on first load` table body rows data not showing correctly
     
    Last edited: Jan 18, 2016
  39. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Re: a)
    You will need to set both the 'Background' color under "General Settings" and 'Normal Background' under "Data Row Settings" to transparent values in order for the table body to be effected. When I set both those values to alpha less than one I get:

    transBackground.png

    Re: b)
    Good catch on that. I just submitted version 1.08 to the Asset Store for approval. A patch for this is included there.

    Thanks for the feedback!
     
  40. Zuicis

    Zuicis

    Joined:
    Mar 14, 2014
    Posts:
    12
    Thanks for the fast response and bugfix :) , about background - tonight i'll try again
     
  41. VadimDobrogursky

    VadimDobrogursky

    Joined:
    Jul 2, 2015
    Posts:
    6
    Hello, thanks for the great asset! Question: How can I change min/max width of the column? Or something like that to control column size individually
     
  42. Zuicis

    Zuicis

    Joined:
    Mar 14, 2014
    Posts:
    12
    Morpher:
    public Column addTextColumn(string header=null, string footer=null, float minWidth=-1, float maxWidth=-1) , found yesterday in one of examples and in their website
     
  43. VadimDobrogursky

    VadimDobrogursky

    Joined:
    Jul 2, 2015
    Posts:
    6
    Oops. Thank you! :) For some reason it's accessible only in constructor. What about resizing?
     
    Last edited: Jan 18, 2016
  44. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    We don't currently support programmatically sizing stuff after initial initialization. Reason being, that leads to a bit of a mess since the table engine itself is peddling hard trying to keep the cells and columns sized automatically for you after you initially tell it how to draw itself.

    We do fully support re-drawing the same table object any number of times though. So, if you want to change the size of a column after it's displayed you'd need to just re-initialize and let the engine redraw:
    Code (csharp):
    1.     this.table.reset();
    2.     this.table.addTextColumn("header", "footer", minWidth, maxWidth);
    3.     this.table.initialize(this.onTableSelectedWithCol);
    4.     for (int i = 0; i < 100; i++) {
    5.       Datum d = Datum.Body(i.ToString());
    6.       d.elements.Add("Col1:Row" + i.ToString());
    7.       this.table.data.Add(d);
    8.     }
    9.     this.table.startRenderEngine();
     
  45. Zuicis

    Zuicis

    Joined:
    Mar 14, 2014
    Posts:
    12
    I just tried your recommendation.. Works only if I leave checkbox in "Use 2d mask". Thank you for the hint :)
     
    slumtrimpet likes this.
  46. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    Hello, everyone! Quick question? Are there any issues trying to integrate this into an interface built with NGUI? It looks fantastic, but I want to make sure I don't run into any potholes along the way :D

    Cheers.
     
  47. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Hi there, TablePro is written in the native Unity UI. Using it alongside NGUI would be the same as using any other native UI element with NGUI... I'd suggest playing around with a native UI image or something similar and see if you are happy with how you can integrate it with NGUI before buying the asset.

    I played with integrations like this many many months ago, but then ended up translating our entire UI out of NGUI and into native Unity UI so I can't speak to how feasible this would be with current releases of NGUI.
     
  48. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    Fair enough! Thanks for the quick response!
     
  49. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    Well, in playing around it with a bit, it doesn't look like its gonna be easy .... but I'll eventually figure it out! :)
     
  50. WalterBoyd

    WalterBoyd

    Joined:
    Sep 25, 2015
    Posts:
    13
    Table Pro was working fine for me yesterday, today the table never paints, I just see the spinning 'loading' icon and a white field. Traced this down to SetLayoutVertical being called continually, which seems to force the control to always be in a repaint mode. What could be causing this?

    (BTW, the sample scenes work fine - I copied verbatim the simple.cs code to my project and still get the spinner, table never paints. )

    Thanks,
    Walter