I have a code that allows me to show/hide a field editor with a checkbox. How do I edit this code for the checkbox to show/hide multiple field editors?
See code below:
// Run the regular renderer
var field = arguments[0],
value = arguments[1],
$ = skuid.$;
// Make sure we’re registered on our model,
// so that we can receive changes
var listener = new skuid.ui.Field(field.row,field.model,null,{fieldId: field.id,register:true});
skuid.ui.fieldRenderers[field.metadata.displaytype]field.mode;
var fe, nextFE;
var getFieldEditors = function(){
if (!fe) {
// Get the closest Field Editor
fe = field.element.closest(‘.decision-home-visit’);
// And find the next Home Visit Field Editor
nextFE = fe.next(‘.home-visit’).first();
}
};
var doIt = function(val) {
getFieldEditors();
// Show/hide the next Home Visit Field Editor
if (val) nextFE.show();
else nextFE.hide();
};
listener.handleChange = function() {
doIt(field.model.getFieldValue(field.row,field.id,true));
};
$(function(){
doIt(false);
});
Question
How do I show/hide field editors?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
