Sometimes we don’t want to keep inline editing on the apex:enhancedList, and unfortunately there is no standard way to disable inline editing. But there is always a solution for , not a standard way but we can say workaround to fulfill the requirement.
Here is the jQuery code snippet which can be put in a javascript function and then we can call this function on the “oncomplete” attribute of apex:enhancedList. Its obvious that you must include jQuery files for the execution of the below code snippet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$("td").each(function(){ var innerDivID = $(this).children().attr('id'); var innerDivIsEditField = false; if(innerDivID !=undefined && innerDivID !=null && innerDivID != '' && (innerDivID.indexOf('_00N') > -1 || innerDivID.indexOf('_Name') > -1)){ innerDivIsEditField = true; } var className = $(this).attr('class'); var classesArray = className.split(' '); var isInlineField = false; var inlineEditClassName = ''; for(var i=0; i< classesArray.length; i++){ if(classesArray[i].indexOf('td-00N') > -1 || classesArray[i].indexOf('td-Name') > -1){ isInlineField = true; inlineEditClassName = classesArray[i]; break; } } if(isInlineField && innerDivIsEditField){ className = className.replace(inlineEditClassName,''); $(this).attr('class',className); } }); |