['command'],
function() {
try {
+ var rows = $('patron_info_rows');
obj.stat_cat_list.clear();
var entries = obj.patron.stat_cat_entries();
for (var i = 0; i < entries.length; i++) {
stat_cat = obj.OpenILS.data.lookup('actsc',entries[i].stat_cat());
}
if (!stat_cat) { continue; }
- if (get_bool( stat_cat.usr_summary() )) {
- obj.stat_cat_list.append( {
- 'row' : {
- 'my' : {
- 'actsc' : stat_cat,
- 'actscecm' : entries[i],
- }
+ // Every stat cat gets rendered in the Stat Cats tab
+ obj.stat_cat_list.append( {
+ 'row' : {
+ 'my' : {
+ 'actsc' : stat_cat,
+ 'actscecm' : entries[i],
}
- } );
+ }
+ } );
+ // But only a proud few share the Patron Info pane
+ if (rows && get_bool( stat_cat.usr_summary() )) {
+ var row_id = 'stat_cat_id_' + stat_cat.id();
+ var row; var label1; var label2;
+ if ($(row_id)) {
+ row = $(row_id);
+ label1 = row.firstChild;
+ label2 = row.lastChild;
+ } else {
+ row = document.createElement('row');
+ row.setAttribute('id',row_id);
+ label1 = document.createElement('label');
+ label2 = document.createElement('label');
+ row.appendChild(label1);
+ row.appendChild(label2);
+ rows.appendChild(row);
+ }
+ label1.setAttribute('value',stat_cat.name());
+ label1.setAttribute('tooltiptext','stat cat id ' + stat_cat.id());
+ label2.setAttribute('value',entries[i].stat_cat_entry());
}
}
} catch(E) {
*/
// Update the screen
- chain.push( function() { obj.controller.render(); } );
+ chain.push( function() {
+ obj.controller.render();
+ if ($('stat_cat_tab')) {
+ util.widgets.dispatch('command','stat_cat_tab');
+ }
+ } );
// On Complete