datatable-sort.js revision d64ab2267df9f30ae1ca6c13bc7f23cb552b86be
//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"),
//CLASS_SORTABLE = getClassName(DATATABLE, "sortable"),
TEMPLATE_TH_LINK = '<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>';
}
Y.mix(RecordsetSort, {
NS: "sort",
NAME: "recordsetSort",
ATTRS: {
dt: {
},
if(sorted === 0) {
}
else {
return sorted;
}
}
}
}
});
initializer: function(config) {
},
destructor: function(config) {
},
_defSortFn: function(e) {
},
},
custom: function() {
alert("sort custom");
},
// force asc
asc: function() {
alert("sort asc");
},
// force desc
desc: function() {
alert("sort desc");
},
// force reverse
reverse: function() {
alert("sort reverse");
}
});
function DataTableSort() {
}
Y.mix(DataTableSort, {
NS: "sort",
NAME: "dataTableSort",
ATTRS: {
sortedBy: {
value: null
}
}
});
initializer: function(config) {
//this.doBefore("_getThNodeMarkup", this._beforeGetThNodeMarkup);
// Attach click handlers
// Attach UI hooks
});
alert('ok');
});
//TODO
//dt.after("recordset:mutation", function() {//reset sortedBy});
//TODO
//add Column sortFn ATTR
},
/*_beforeGetThNodeMarkup: function(o, column) {
if(column.get("sortable")) {
o.link_class = "foo";
o.link_title = "bar";
o.link_href = "bat";
o.value = Y.substitute(this.thLinkTemplate, o);
}
},*/
_onEventSortColumn: function(e) {
e.halt();
dir = (prevSortedBy &&
}
});