We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Access array value in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

130048 Apr 18,2017 12:27 PM Apr 19,2017 01:00 PM Angular 1
loading
Tags: ejGrid
Zack
Asked On April 18, 2017 12:27 PM

    <ej-grid #grid id="Grid"
    [dataSource]="data">
        <e-columns>
        <e-column field="recommendations[0].prop1" headerText="prop1"></e-column>   
        <e-column field="recommendations[0].prop2" headerText="prop2"></e-column>          
        </e-columns>
    </ej-grid>



Not sure how to implement something like this, structures is like this

data= [
     { 
          recommendations: [
            {
               prop1: 'hello',
               prop2: 'goodbye'
            }
          ]
     }
]

Thavasianand Sankaranarayanan [Syncfusion]
Replied On April 19, 2017 01:00 PM

Hi Zack, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suspect that you want give dataSource for the ejGrid control. 

Refer the below code example. 

[app.cpmponent.html] 

<ej-grid id="Grid" #grid  [dataSource]="data" [allowPaging]="true"> 
    <e-columns> 
        <e-column field="EmployeeID"  headerText="Employee ID"  ></e-column> 
        <e-column field="OrderID" headerText= "Order ID" ></e-column> 
    </e-columns> 
</ej-grid> 
 
---------------------------------------- 
[app.component.ts] 

export class AppComponent { 
 
 
    public data = [ 
 
        { OrderID: "10248", EmployeeID: 1 }, 
        { OrderID: "10249", EmployeeID: 2 }, 
        { OrderID: "10250", EmployeeID: 3 }         
    ] 
} 




Refer the help documentation. 



Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;