Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
Cannot copy values from from igx-grid
posted

Hi everyone,

I use an igx-grid in my application. It looks like this:

And my data and the clipboardOptions are defined like this:

In the clipboardOptions I set the value for "copyHeaders" to false because I do not want to copy this data. 
But if I select a value in my span or my input-field it simply does not copy anthing to the clipboard. If I paste the data to a texteditor, nothing is pasted.


So my question is:

How can I enable, that I can copy data from an igx-grid where I define my columns with an ng-template.

If you need further information, please let me know.

Thanks in advance.

Regards

Michael

  • 700
    Verified Answer
    Offline posted

    Hello Michael,

    Thank you for posting in our community!

    I have been looking into your question and an approach I could suggest in order to copy data from an IgxGridComponent when the columns are defined with an ng-template is to use the IgxColumnComponent’s field property and set it for each column as this property is used to configure which column will correspond to which property in the data set. For this specific example, this should look like the following:

    <igx-column header="cell header" field="value">
        <ng-template igxCell let-cell="cell">
            <span>{{ cell.row.data.value }}</span>
        </ng-template>
    </igx-column>
    
    <igx-column header="input header" field="value">
        <ng-template igxCell let-cell="cell">
            <igx-input-group>
                <input igxInput type="text" [(ngModel)]="cell.row.data.value" />
            </igx-input-group>
        </ng-template>
    </igx-column>
     

    Please test this approach on your side and let me know if you need any further assistance regarding this matter.

    Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Entry Level Software Developer