altRow) {
cn = "cssTableAltRow";
} else {
cn = "cssTableRow";
}
var tr = document.createElement("tr");
tr.setAttribute("class", cn);
tr.setAttribute("valign", "middle");
return tr;
}
}
);
altRow = !altRow;
}
As you can see, we have a cellFuncs array, which you should be pretty familiar with by
now. Next, we check to see whether the current user is an administrator, is the project manager
for the current project being worked with, or is assigned to the project. If any of these
conditions is true, the project will be displayed in the summary, so only projects that pertain
to the user will be displayed. Once that??™s determined, it??™s just a dwr.util.addRows() call that
you??™ve seen a bunch of already. Note that this is again a string delimited with the ~~ sequence,
which the cellFuncs functions split the string on to return the correct portion of the string for
each cell in the table. Also note that the last cell in the table is where the project status icon
image appears, and here there??™s a call to calculateProjectStatus(), which we??™ll see in a bit. In
short, it returns a snippet of HTML that shows the appropriate image.
Something a little different here is the rowCreator element of the options object, which is
the final argument passed to dwr.
Pages:
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844