diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-10 13:12:18 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-10 13:12:18 -0400 |
commit | 9d7aa0e971f5a4b33f82fd46573fe6cceaa8c4a8 (patch) | |
tree | f3ec6695afd603dc4f3cf6f5ceadc3686b18be57 /GradeBook_lib.tcl | |
parent | 11e54ebe50bbb70d520b80fd7472837ccc1ce39b (diff) | |
download | GradeBook-9d7aa0e971f5a4b33f82fd46573fe6cceaa8c4a8.tar.gz GradeBook-9d7aa0e971f5a4b33f82fd46573fe6cceaa8c4a8.zip |
made some columns sticky during scrolling
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index b6fbee4..842a8dd 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -13,6 +13,8 @@ source ./libBasicTableOperations.tcl # internal version of this code set VERSION 2.0.0 +set sticky_colums_list [list FirstName LastName UserCount ] + # ######################################################################## # this should be in config file but these are reasonable defaults array set GradebookServerConfig [list \ @@ -1198,6 +1200,10 @@ proc htmlGradesTableHeadersRaw { permission_list user sql_column_str hidden_colu } else { set category [SelectColValue4User $col _Col_Category_] } + global sticky_colums_list + if { $col in $sticky_colums_list } { + set category "$category $col sticky-col" + } set sort_symbol "↓"; # down arrow set col_text "$col" if { $col eq "UserCount" } { @@ -1289,6 +1295,7 @@ proc htmlFormatMaxPossibleRaw { sql_column_str hidden_columns } { array set v [getColAndValForUserName _Max_Points_ $sql_column_str $hidden_columns] # we need to prepend column list with UserCount column, so the counter appears first set v(*) [linsert $v(*) 0 UserCount] + global sticky_colums_list foreach c $v(*) { if { $c in $hidden_columns } continue switch $c { @@ -1305,7 +1312,11 @@ proc htmlFormatMaxPossibleRaw { sql_column_str hidden_columns } { } } } - puts "<td> <b>$out_str</b> </td>" + set category "" + if { $c in $sticky_colums_list } { + set category "$category $c sticky-col" + } + puts "<td class=\"$category\"> <b>$out_str</b> </td>" } puts "</tr>" } @@ -1404,6 +1415,10 @@ proc htmlFormatColVal { col_value columnname user user_shown permission_list {fo set category [SelectColValue4User $columnname _Col_Category_] set max_points [SelectColValue4User $columnname _Max_Points_] } + global sticky_colums_list + if { $columnname in $sticky_colums_list } { + set category "$category $columnname sticky-col" + } set special_user_names [list _Max_Points_ _The_Highest_Grade_ _The_Lowest_Grade_ _The_Mean_Grade_ _The_Median_Grade_ _The_StDev_Grade_ ] if { (([SelectColValue4User GroupName $user_shown] ne "inforow") || ($user in $special_user_names)) && ($category eq "weighted_column") && ($max_points != 0) } { if { $col_value eq "" } { |