Sort images

Sort images

cgeecgee Posts: 3Questions: 0Answers: 0
edited August 2012 in Plug-ins
Hey Guys,

I'm new here and first a question.
I want to include the plug-in to sort images.

So I do this?! (right?)

[code]

$(document).ready(function(){
$('#the_table').dataTable({

"aoColumns":
[
null,
null,
null,
{ "sType": "title-string" },
{ "sType": "title-string" },
null
]

});
});

[/code]

But where comes the alt string code?

[code]

jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"alt-string-pre": function ( a ) {
return a.match(/alt="(.*?)"/)[1].toLowerCase();
},

"alt-string-asc": function( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},

"alt-string-desc": function(a,b) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
} );

[/code]

Can someone help me with a detailed description?

Thank you guys!

Replies

  • cgeecgee Posts: 3Questions: 0Answers: 0
    @Edit:

    Firebug tells
    [code]oSort[ (sDataType ? sDataType : 'string')+"-"+aaSort[k][1] ] [/code]
    this is not a function
  • cgeecgee Posts: 3Questions: 0Answers: 0
    ups.. my fault.

    [code]

    $(document).ready(function(){
    $('#the_table').dataTable({

    "aoColumns":
    [
    null,
    null,
    null,
    { "sType": "title-string" },
    { "sType": "title-string" },
    null
    ]

    });
    });

    [/code]

    thats wrong.
    with alt-string works all fine!
    Can be closed here.
This discussion has been closed.