I have datatable with a lot of different values from fields and I need to calculate and show these values in datatable. I have getters for now which call function. Is it possible to call this function from LWC component's HTML markup instead of call it from each getter?
-
1Can you be more specific of what you're trying to achieve?– sfdcfoxSep 28, 2020 at 13:51
-
@sfdcfox I just edited my question– Igor VasylevskyiSep 28, 2020 at 14:34
-
1You can call functions that exist in your JS file and tie events to your HTML markup, but I don't think that answers specifically what you're looking for. What data are you trying to get and when are you trying to get it?– nbrownSep 28, 2020 at 14:36
-
@nbrown I need to dynamically render text based on field value. So as sfdcfox said it's not possible to call method from markup and I should use getters– Igor VasylevskyiSep 28, 2020 at 14:56
1 Answer
In your markup, you can only call getters and specify event handlers, which can only be triggered in response to an event. It is not possible to put functions directly in markup.