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. Image for the cookie policy date
close icon

dataStateChange event signature is different than in your documentation

Hi,
we're trying to create custom binding for the grid based on your documentation and we have problems.
We're using typescript and version of ej2 17.2.39.

We're following this documentation page: https://ej2.syncfusion.com/react/documentation/grid/data-binding/#custom-binding

Typescript won't compile because dataStateChange signature is different then in your documentation

public dataStateChange(state : DataStateChangeEventArgs) {
      this.orderService.execute(state).then(( gridData ) => {
          if(this.grid) {
            this.grid.dataSource = gridData
          }
        });
    }
This is the error:
Types of property 'dataStateChange' are incompatible.
  Type '(state: DataStateChangeEventArgs) => void' is not assignable to type 'EmitType<DataStateChangeEventArgs>'.
    Type '(state: DataStateChangeEventArgs) => void' is not assignable to type '(arg?: DataStateChangeEventArgs | undefined, ...rest: any[]) => void'.
      Types of parameters 'state' and 'arg' are incompatible.
        Type 'DataStateChangeEventArgs | undefined' is not assignable to type 'DataStateChangeEventArgs'.
          Type 'undefined' is not assignable to type 'DataStateChangeEventArgs'.

3 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 2, 2019 10:54 AM UTC

Hi Drasko, 

Greetings from Syncfusion.  

We are unable to reproduce the problem at our end. We have prepared a sample with the latest version 17.2.39 and it is working fine. Refer to the following demo.  


Please confirm your version details and also share your component page. 

Regards,  
Seeni Sakthi Kumar S. 



DP Drasko Popovic August 2, 2019 01:33 PM UTC

Thanks Seeni,
your example helped. Problem was that we were using typescript 3.5.3. Once we downgraded the typescript to as in your example 3.3.3 it started to work.

Should we avoid using typescript greteer then 3.3.3?


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 5, 2019 09:05 AM UTC

Hi Drasko,  

Greetings from Syncfusion.  

We have checked with the typescript version 3.5.3 and it is working fine at our end. Refer to the following sample demo.  


We suspect that you are using the older version of the Syncfusion Packages. Please check the package.json was given the ej2-react-grids with the v17.2.39 and ensure other related packages also.  

Regards,  
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon