Get row count for FM grid

Answered
Thien Duong asked on May 24, 2023

Hi,
I noticed in our recent FM upgrade that the method gridRowCount() was removed in FM 2.3.
Is there any replacement method to retrieve the row count?
 
Thank you.

8 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster May 25, 2023

Hello,

Thank you for reaching out to us.

The gridRowCount method is still supported for backward compatibility. Kindly note that it is not recommended because the method can be removed in future releases.

You are welcome to contact us in case further questions arise.

Kind regards,
Nadia

Public
Thien Duong May 25, 2023

I got this message while trying to call the method. How do we make a method call through backward compatibility? How do we enable backward compatibility?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster May 26, 2023

Hello,

Thank you for the response.

You can use the bracket notation to access the deprecated methods and explicitly specify the <any> type for the pivot.
Please, try the following code:

console.log('flexmonster.gridRowCount()', (<any>this.pivot.flexmonster)['gridRowCount']());

Please let us know if it works for you. Looking forward to your response.

Kind regards,
Nadia

Public
Thien Duong May 31, 2023

I was not able to use the snippet above,
Is there a JSFiddle you can provide?
Thanks

Public
Thien Duong May 31, 2023

I changed it to 

console.log('flexmonster.gridRowCount()', (this.flexmonster as any)['gridRowCount']());

 
since we're running on Typescript
 
and was able to run however, the method still doesn't exist
 
 

Public
Maksym Diachenko Maksym Diachenko Flexmonster June 2, 2023

Hello, 

Thank you for your feedback.
The error from your screenshot indicates that this.flexmonster is null. We recommend checking that the Flexmonster object you access to run gridRowCount method is not null. 
Please let us know if our recommendation helped you to solve the issue.

Best Regards,
Maksym

Public
Thien Duong June 2, 2023

Hi Maskym,
That's working now, thank you. Ticket can be closed.
 
Thien D.

Public
Maksym Diachenko Maksym Diachenko Flexmonster June 6, 2023

Hi, Thien!

Thank you for the reply.
We are glad to hear that everything works fine for you.
Feel free to contact us if more questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer