I have developed a few custom Thingsboard widgets. It seems that I am able to access much of @angular/material
from within my widget code. I am utilizing mat-table
successfully, but in order to easily support pagination/filtering/sorting etc. I would like to utilize the MatTableDataSource
class - this is resulting in an error as this class is apparently not exposed. How can I access MatTableDataSource
from within my custom widget code?
Asked
Active
Viewed 258 times
-1

pooley1994
- 723
- 4
- 16
1 Answers
1
As for 3.3.4.1 version you can't import so can't use such classes in JS section of custom widget.
I just grep
the source code and found nothing about MatTableDataSource.
There is similar question in the official bugtracker and there is no suggestion as well (16/06/2022).

devaskim
- 492
- 3
- 10
-
1do you have any further information @devaskim? I have already stated that I've been unable to do it - would you happen to be able to share how you confirmed this? or whether there is any way to work around it? – pooley1994 Jun 15 '22 at 17:54
-
I [could find](https://imgur.com/a/jKFCoFF) any export of this class in Thingsboard source code. Unfortunately, at the moment I don't know any workaround – devaskim Jun 15 '22 at 18:34
-
By the way [the same question](https://github.com/thingsboard/thingsboard/issues/6517) is without any answer for 3 months. – devaskim Jun 15 '22 at 18:39
-
Yeah, I'd seen that Github question too :/ oh well. Thanks – pooley1994 Jun 15 '22 at 18:50
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 16 '22 at 05:31
-
1@pooley1994 If you are building your instance from source code (TB CE version), you can export this class as it has already done for [some RxJS API](https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/modules/home/models/widget-component.models.ts#L266-L273). – devaskim Jun 16 '22 at 06:15
-
Thanks for following up @devaskim. We are not building our TB from source. For now I am just opting to implement table functionality in absence of `MatTableDataSource`. – pooley1994 Jun 16 '22 at 15:07