Forum Replies Created
-
AuthorPosts
-
using this :
function setTabToReadOnly(tabIdx){
console.log(“function: setTabToReadOnly: ” + tabIdx);
var arrToSetReadonly = [];
//jQuery.each(spjs.dffs.data.tabFieldsObj,function(fin,o){
jQuery.each(spjs.dffs.data.tabConfigObj[tabIdx].fields,function(i,fin){arrToSetReadonly.push(fin);
});spjs.dffs.doReadOnly(arrToSetReadonly);
spjs.dffs.toggleSaveBtnByRule(false); /* hide save button */
}Hi, I am trying to use the below code to make all the fields in Tab0 (I’ve 2 tabs and one should be read only based on access level) read only and noticing couple of things:
1. it doesn’t seem to work for all the fields. Some fields still show as editable. What could be the issue?
2. The multiselect checkboxes all align in one column (using function multichoiceVertical -see below to align checkboxes horizontally) but calling setTabToReadOnly is removes the format
function setTabToReadOnly(tabIdx){
console.log(“function: setTabToReadOnly: ” + tabIdx);
var arrToSetReadonly = [];
jQuery.each(spjs.dffs.data.tabFieldsObj,function(fin,o){
// jQuery.each(spjs.dffs.data.tabConfigObj[tabIdx].fields,function(i,fin){arrToSetReadonly.push(fin);
});spjs.dffs.doReadOnly(arrToSetReadonly);
spjs.dffs.toggleSaveBtnByRule(false); /* hide save button */
}function multichoiceVertical(arr,breakAfter){
var toFind, index, counter, table;
toFind = “td.ms-formbody”;
if($(“td.ms-formbodysurvey”).length>0){
toFind = “td.ms-formbodysurvey”;
}
$.each(arr,function(i,fin){
if(fields[fin]!==undefined){
index = 0;
counter = 0;
table = $(fields[fin]).find(toFind+’ table:first’);
$(table).prepend(“<tr id=’vertical_”+fin+”_”+index+”‘></tr>”);
$(table).find(‘tr:first’).nextAll().each(function(){
if(counter%breakAfter===0){
$(“#vertical_”+fin+”_”+index).after(“<tr id=’vertical_”+fin+”_”+(index+1)+”‘></tr>”);
index += 1;
}
$(this).find(‘td:first’).appendTo($(“#vertical_”+fin+”_”+index));
$(this).remove();
counter += 1;
});
}
});
}- This reply was modified 6 months, 3 weeks ago by Rad.
-
AuthorPosts