UPDATE: to quickly summarize, 1st clause (based on profile name) works. 2nd clause (based on UI-only field) does not work.
I have an In-line Javascript code to add CSS properties.
It works fine for the first clause of the if statement (a user whose profile starts with “RO_”).
I have a UI-field, in the model ‘Office’, that I would like to do the same with.
I confirmed in the developer console that “UIinput” equals RegionalOffice, once it is selected in the picklist. (Which would make the else if clause true)
I suspect it has something to do with function being run on page load, but was hoping someone could confirm that for me. I am still a JavaScript newbie.
Thanks in advance for any help.
(function(skuid){ var $ = skuid.$;
$(document.body).one(‘pageload’,function(){
var profile = skuid.utils.userInfo.profileName;
var profilePrefix = profile.substring(0, 3);
var UIfield = skuid.model.getModel(‘Office’);
var UIinput = UIfield.data[0].OfficeType;
if (profilePrefix === “RO_”) {
$(function() {
$(‘.corp-exclusive’).css(“display”, “none”);
});
} else if (UIinput === “RegionalOffice”) {
$(function() {
$(‘.corp-exclusive’).css(“display”, “none”);
});
} else {
console.log(UIinput);
}
});
})(skuid);
Question
UI-Only field to add CSS properties
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.