Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Won't Do
-
Affects Version/s: HR-1.0
-
Fix Version/s: HR-1.0
-
Component/s: None
-
Labels:None
Description
In the job screen, there's a summary for each job, including a block for "Pay". The pay should be displayed with commas (e.g. "2,500.00 USD per month").
Note: As a bit of background:
- Tthe summary view begins in js/jobtabapp/summary/summary_views.js (CRM.HRApp.JobTabApp.Summary.ShowView).
- It embeds several smaller views – for example, the "Pay" field is actually an instance of CRM.HRApp.JobTabApp.Summary.SimpleItemView with the template "#hrjob-pay-summary-template".
- You'll need to update #hrjob-pay-summary-template.
- Easier approach – Add a new helper function to renderutil.js (e.g. "RenderUtil.currency = function(amount)
{ ... }
") and then call it in #hrjob-pay-summary-template.
- Harder approach – Add a parameter called "onBindingCreate" and use it to set a value-converter. There's an example of onBindingCreate in js/jobtabapp/general/edit_views.js, and there's more discussion about converters at https://github.com/theironcook/Backbone.ModelBinder ("Formatting and converting values").
- Personally, I'd probably do the easier approach, but the harder approach has some functional benefits (e.g. it works with plain-text output and form elements; also, any outputs handled through ModelBinder are automatically updated when the underlying data changes).