I have an attribute that is the full path of a file.
In the datatable I want just the file name (after the last ‘/’).
I can’t do this with a template string, so I tried with a template function, however I get all of the items in the table in the function. I was expecting to get an item for each row.
For me the object that is passed into the function for the template (obj, in your example) is an object representing the response from the “url” attribute.
Which contains all of the rows, and there is no way to get the object for the current row.
I’m not using the data attribute. I’m using the “url” attribute. That is what the data looks like.
It doesn’t matter. The only difference between url and data that data is fetched by ajax call in the first case. All other data processing logic is the same for both.
When you are using url server side must return an array of object. That is default data format expected by component. if code returns something like { jobs:[ ]}, it will not be rendered correctly.
If you can’t change the syntax of server side code, try to use