Skip to content

Instantly share code, notes, and snippets.

@zachelrath
Created March 30, 2013 14:54
Show Gist options
  • Save zachelrath/5276990 to your computer and use it in GitHub Desktop.
Save zachelrath/5276990 to your computer and use it in GitHub Desktop.
Inline Snippet field renderer for the Quantity field on OpportunityLineItem object. Forces a concurrent update of the UnitPrice/SalesPrice field whenever Quantity is updated.
var field = arguments[0],
value = arguments[1];
if (field.mode == 'read') {
skuid.ui.fieldRenderers.DOUBLE.read(field,value);
} else {
skuid.ui.fieldRenderers.DOUBLE.edit(field,value);
skuid.utils.delayInputCallback(
field.element.find('input'),
function(newValue) {
// Force updates of the UnitPrice (Sales Price) field
field.model.updateRow(
field.row,
'UnitPrice',
field.model.getFieldValue(field.row,'UnitPrice')
);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment