Format data extracted from DB

Peter Flower6 years ago

Hi, how are you, please your help with this:
I wanna extract some information of a position (Ext.getStore('LatestPositions').findRecord), in this case: "speed"

speed = position.get['speed'];

The information will be show in a table like this:
Label ==> row 3
Data ==> row 4

1: <table width="100%" border="0" cellspacing="0" cellpadding="0">
2:   <tr>
3:     <td>Strings.positionSpeed</td>
4:     <td>Traccar.AttributeFormatter.getFormatter('speed')(speed)</td>
5:   </tr>
6: </table>

The problem is in the line 4, I don't know how can I format the information extracted from the DB.
I have tried many ways but I couldn't, please your help with this problem.

Traccar.AttributeFormatter.getFormatter('speed') ==> this line returns a function.

Best Regards
Peter

Peter Flower6 years ago

Dear @anton, could you give me a hand with this?

Peter Flower6 years ago

The line 4 is correct!! It seems was a problem of the concatenation.