Picklist Actions

  • 1
  • Question
  • Updated 4 years ago
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Fixed Bugs, Redundant Posts

I only understand the basics of javascript, but how would I go about defining an action dependent on a picklist value? And would that just be an inline item?

Something along the lines of...
var model = skuid.model.getModel('Contacts')

if (model.picklist__c.value = 'Delete')
then {modelrow.deleteRow}
Model.save({callback:function(result){}});
?
Photo of Jake Stallman

Jake Stallman

  • 386 Points 250 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Jake Stallman

Jake Stallman

  • 386 Points 250 badge 2x thumb
I got a version of it to work. Probably not the best way, but it works.
var params = arguments[0],
    Contact = params.item ? params.item.row : params.row,
    ContactsModel = params.model;
var $ = skuid.$,
    field = arguments[0],
    value = arguments[1];

skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode]( field, value );
if (value == 'Delete') {ContactsModel.deleteRow(Contact);
    ContactsModel.save({callback:function(result){
    ContactsModel.updateData();}
                });}

This conversation is no longer open for comments or replies.