question

Upvotes
Accepted
76 16 21 29

How do you reset emerald-grid?

I have code which works fine:

            myGrid.config = {
              columnReorder: false,
              rowHighlight: true,
              rowSelection: true,
              columns: myColumns,
              dataModel: {
                fields: fields,
                format: 'array',
                data: myData
              }
            };

But if I attempt to configure the grid later (to add an additional column) it doesn't work. (In fact, if I just run this code snippet above twice in succession, i.e. without even altering the inputs, the grid appears blank).

I have an ugly workaround which is to reset the innerHTML of a <div> containing my grid like so...

document.getElementById("div_" + tName).innerHTML = '<emerald-grid id="' + tName + '" height="192px"></emerald-grid>';

...but surely there must be a better way?

eikoneikon-app-studio
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
257 1 3 5

Hi Tristan,

You can modify the grid (like adding/removing columns, manipulate its data, ...) using the grid api without re-creating the grid. You can check out the samples in Eikon Web UI side (cpurl://apps.cp./apps/eikonwebui) and go to Eikon Components -> TR-Grid -> Composite Grid

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.