I have followed the instructions on this page to create a drag and drop queue. I wanted to display more data on the card but some of the data I want to conditionally show. I wrote an ‘if’ statement to do this and the correct info prints in the console but not on the template.
Basically if the deadline field has a value then show the value otherwise don’t.
Can someone point out the error of my ways?
Thanks!
Altered Code:
var args = argumentsu0], item = args.item, list = args.list, model = args.model, element = args.element, row = item.row, deadline = row.Custom_Field__c, renderTemplate = '{{{Name}}}
{{Amount}}
' if(deadline !== ""){ "D:"+ deadline; console.log('Deadline' + deadline); } else{ null; }
Original Code:
- var args = argumentsu0],
- item = args.item,
- list = args.list,
- model = args.model,
- element = args.element,
- row = item.row,
- renderTemplate = '{{{FirstName}}} {{{LastName}}} - {{{Company}}}',
- mergeSettings = {
- createFields: true,
- registerFields: true
- };
-
- element.html(
- skuid.utils.merge('row',renderTemplate,mergeSettings,model,row)
- );