Selector Mappings

Steven Githens swgithen at mtu.edu
Wed Nov 25 18:22:11 UTC 2009


While I'm digging back into this,  has there been any effort to reduce 
or automate selector mappings?  These things.[1]

I could probably shorten it to an array and then run it through a 
processor function.  However, I'd really like to just use a naming 
convention with ID's and attributes and not write any selector mappings 
at all (except for the occasional special scenerio).

I guess that would require traversing the component tree right before 
(or during) rendering to check for the convention and add it to the 
selector map if it matches, as one approach.

Has anything like this baked into the framework already before I fiddle 
with it too much?

Cheers,
Steve


[1]
asnn2subview.selectorMap = [
  { selector: ".row", id: "row:" },
  { selector: ".sub-table-header", id: "header:" },
  { selector: ".student-name", id: "student-name"},
  { selector: ".submitted-time", id: "submitted-time"},
  { selector: ".submission-status", id: "submission-status"},
  { selector: ".grade", id: "grade"},
  { selector: ".review-score", id: "review-score"},
  { selector: ".review-error", id: "review-error"},
  { selector: ".review-multiple", id: "review-multiple"},
  { selector: ".review-pending", id: "review-pending"},
  { selector: ".feedback-released", id: "feedback-released"},
  { selector: ".student-grade-link", id: "student-grade-link"},
  { selector: ".student-name-sort", id: "student-name-sort" },
  { selector: ".student-name-sort-img", id: "student-name-sort-img" },
  { selector: ".submitted-time-sort", id: "submitted-time-sort"},
  { selector: ".submitted-time-sort-img", id: "submitted-time-sort-img"},
  { selector: ".submission-status-sort", id: "submission-status-sort"},
  { selector: ".submission-status-sort-img", id: 
"submission-status-sort-img"},
  { selector: ".submission-report-sort", id: "submission-report-sort" },
  { selector: ".submission-report-sort-img", id: 
"submission-report-sort-img" },
  { selector: ".feedback-released-sort", id: "feedback-released-sort" },
  { selector: ".feedback-released-sort-img", id: 
"feedback-released-sort-img" },
  { selector: ".grade-sort", id: "grade-sort" },
  { selector: ".grade-sort-img", id: "grade-sort-img" },
  { selector: ".grade-col-header", id: "grade-col-header" },
  { selector: ".grade-td", id: "grade-td" },
  { selector: ".report-col-header", id: "report-col-header" }
];



More information about the fluid-work mailing list