datatable-sort.js revision 2e56ffe5732f32d088120e956e5b1d3796c807e3
//TODO: break out into own component
var //getClassName = Y.ClassNameManager.getClassName,
//DATATABLE = "datatable",
ASC = "asc",
DESC = "desc",
//CLASS_ASC = getClassName(DATATABLE, "asc"),
//CLASS_DESC = getClassName(DATATABLE, "desc"),
TEMPLATE_TH_LINK = '<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>';
function DataTableSort() {
}
Y.mix(DataTableSort, {
NS: "sort",
NAME: "dataTableSort",
ATTRS: {
trigger: {
value: "theadCellClick",
writeOnce: "initOnly"
},
sortedBy: {
value: null
}
}
});
initializer: function(config) {
// Wrap link around TH value
// Add class
this.doBefore("_attachTheadThNode", function(o) {
});
// Attach click handlers
// Attach UI hooks
});
alert('ok');
});
//TODO
//dt.after("recordset:mutation", function() {//reset sortedBy});
//TODO
//add Column sortFn ATTR
// Update UI after the fact (plug-then-render case)
}
},
_beforeCreateTheadThNode: function(o) {
link_class: "foo",
link_title: "bar",
link_href: "bat",
});
}
},
_onEventSortColumn: function(e) {
e.halt();
//TODO: normalize e.currentTarget to TH
dir = (prevSortedBy &&
}
}
});