Is there a way I can rearrange the list of employees shown in the employee directory page based on certain field values of each employee.

Currently, am using javascript/jquery to rearrange using insertBefore and insertAfter, but am not able to fetch the entire div tag to place before another div tag. Any suggestions would be helpful.

// If the job title is in the list of managerTitles, make this person the first in the list if they're not aready first

    if($.inArray(jobTitle3, managerTitles) >= 0) {
                // If they're not first in the list, move them there"
                if(personIndex > 0) {
                    // Move the manager to first
                    $(this).insertBefore($('.psrch-FullResult:first'));
                }

                // Insert a block div to create a line break after the manager
                $("<div style='display:block;clear:both;'></div>").insertAfter($('.psrch-FullResult:first'));

            }

$(this) represents the current object. But I don't see any change in the result being displayed. Any suggestions

When a condition is satisfied, I want to move the entire div before all of them and show it on the top and seperate this from the other with a div tag.

0

There are 0 best solutions below