DevEx dxDataGrid "state" Method

Answered
0
0

Hi.

I am trying to get the dxDataGrid “state()” as documented here: https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#state

I have tried:

var loState = await this.dxDataGrid1.Instance.state();

But this returns null.

Also, adding a WidgetFunction (named getState) through the Designer:

return this.Instance.state();

And then, from the server:

var loState = await this.dxDataGrid1.CallAsync("getState");

But I get an Error in the Console:

dxDataGrid1.getState:5 Uncaught TypeError: Cannot read property ‘state’ of undefined

Would anyone have a tip on how I could get the dxDataGrid “state()” ?

Thanks in advance.

Ivan
(Wisej 2.2.46.0 – VS 2019 – C#)

  • You must to post comments
Best Answer
0
0

Use

var state = await this.dxDataGrid1.Instance.stateAsync();

The state() method in devextreme returns a promise (https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#state) which is an asynchronous method.

 

  • You must to post comments
0
0

Thank you, Luca.

  • You must to post comments
0
0

OK, got it to work using the WidgetFunction, entering the following:

return App.FornecedoresMaintenance.tcView.tpGrid.dxDataGrid1.widget.state();

I saw the this.Instance.state() in the DevEx Sample solution from Wisej GitHub. Why is it it works in that case?

Cheers.

Ivan

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.