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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get instance of Syncfusion component (ejGrid) and how to use methods

Thread ID:

Created:

Updated:

Platform:

Replies:

129028 Feb 22,2017 12:42 PM UTC Feb 23,2017 05:11 AM UTC Angular 2
loading
Tags: ejGrid
Me
Asked On February 22, 2017 12:42 PM UTC

Hey

What is the best way to get instance of Syncfusion component (for instance: ejGrid) without using ID?

At the moment I'm using this:

I get some kind of instance, but there are no methods which would be useful for me. None of them from API page. At the moment, my goal is to reload grid by using refreshContent.
How can I do that?

ie: myGridComponent.widget.refreshContent(true); <-- not working



Me
Replied On February 22, 2017 12:49 PM UTC

Oooops - my bad. Looks like there are those methods, even if I don't see them through console.log(); 

For anyone who will be looking:

// ------------------------------------
import { EJComponents } from './../../../../../../node_modules/ej-angular2/src/ej/core'; <--- Path might be different, depends where about is your current component

@Component({
selector: 'mySelectorName'
 template: `<ej-grid #myGrid></ej-grid>
})

@ViewChild('myGrid') myGridComponent: EJComponents<ej.Grid, any>;

  public Refresh()
  {
    this.myGridComponent.widget.refreshContent(true);
  }
// ------------------------------------


or

// ------------------------------------
@Component({
selector: 'mySelectorName'
 template: `<ej-grid #myGrid></ej-grid>
})

@ViewChild('myGrid') grid:any;

  public Refresh()
  {
    this.
grid.widget.refreshContent(true);
  }
// ------------------------------------


Solved.

Prasanna Kumar Viswanathan [Syncfusion]
Replied On February 23, 2017 05:11 AM UTC

Hi Mantelis, 

Thanks for contacting Syncfusion support. 

We are happy to hear that your issue has been solved. 

Please get back to us if you need any further assistance. 

Regards, 
Prasanna Kumar N.S.V 


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.

Warning Icon 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.Close Icon

;