-function yuiToolbar() {
- var downloadmenu = [
- { text: _("iso2709"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=iso2709&bib_list=[% bib_list %]" },
- { text: _("RIS"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=ris&bib_list=[% bib_list %]" },
- { text: _("BibTex"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=bibtex&bib_list=[% bib_list %]" },
-[% FOREACH csv_profile IN csv_profiles %]
- { text: _("CSV - [% csv_profile.profile %]"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id %]&bib_list=[% bib_list %]" },
-[% END %]
- ];
- new YAHOO.widget.Button({
- type: "menu",
- label: _("Download"),
- name: "downloadmenubutton",
- menu: downloadmenu,
- container: "downloadcartc"
- });
-}
+ /* Define two custom functions (asc and desc) for string sorting */
+ jQuery.fn.dataTableExt.oSort['callnumbers-asc'] = function(x,y) {
+ var x_array = x.split("<div>");
+ var y_array = y.split("<div>");
+
+ /* Pop the first elements, they are empty strings */
+ x_array.shift();
+ y_array.shift();
+
+ x_array.sort();
+ y_array.sort();
+
+ x = x_array.shift();
+ y = y_array.shift();
+
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+ };
+
+ jQuery.fn.dataTableExt.oSort['callnumbers-desc'] = function(x,y) {
+ var x_array = x.split("<div>");
+ var y_array = y.split("<div>");
+
+ /* Pop the first elements, they are empty strings */
+ x_array.shift();
+ y_array.shift();
+
+ x_array.sort();
+ y_array.sort();
+
+ x = x_array.pop();
+ y = y_array.pop();
+
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+ };
+
+ $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "sDom": 't',
+ "aoColumnDefs": [
+ { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+ { "aTargets": [ 3 ], "sType": 'callnumbers' },
+ ],
+ "aaSorting": [[ 1, "asc" ]],
+ "bPaginate": false
+ }));
+
+ });