PreviewWidget of type table does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unity-js-scopes |
Fix Committed
|
Undecided
|
Marcus Tomlinson |
Bug Description
I'm trying to use a PreviewWidget of type 'table' but have had no success so far.
The C++ API docs say that the 'values' attribute expects an array with one element per row. Each element is supposed to be an array with two strings: label and value. So if I understand correctly I should be able to feed it something like:
var details = scopes.
details.
details.
"values",
[
["type", result.
]
);
This does not work. It does not fail with an error, but the generated widget only displays the title, and no table rows.
Looking at the source code for preview-widget.cc, the add_attribute_
details.
"values",
{
"type": result.get("type"),
"channels": result.
"filesize": result.
}
);
This also does not work, I get the same result (nothing is displayed in the table widget).
I guess my first attempt should have worked. The second attempt, even if it did work, would be inappropriate, because it would not be possible to use the same label on different rows of the table.
Related branches
- Alexandre Abreu (community): Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 45 lines (+22/-11)1 file modifiedsrc/bindings/src/preview-widget.cc (+22/-11)
Changed in unity-js-scopes: | |
status: | In Progress → Fix Committed |
Yeah, your first code snippet is correct. Pushing a fix for this now.