Is there a way to display empty table in TableWidget if specific property of parent model is false?
I have created TableWidget inside which I have Table with custom query that pulls data from some external model. I'm displaying this widget on view resource page in footer.
What I'm trying to do is to display empty table based on state of resource model property on which I'm displaying widget.
I have tried to add conditional to table query to simply set it to null but I get error that my widget needs to have a query().
Any help will be appreciated.
Thanks
Solution:Jump to solution
Ok, I have done it:
In order to have empty widget table when parent record is disabled I have overridden
getTableRecords()
method in table widget like this:
```php...1 Reply
Solution
Ok, I have done it:
In order to have empty widget table when parent record is disabled I have overridden
getTableRecords()
method in table widget like this: