jQuery sort tables -
i took lead form post ( jquery table sort ) - in trying im doing...
the code here. http://jsfiddle.net/daqgc/
it's not working... thoughts
here's js code. html can found on jsfiddle.
var user_table = $( '#users' ); $('#company_header, #user_header, #email_header, #type_header') .wrapinner('<span title="sort column"/>') .each(function(){ var th = $(this), thindex = th.index(), inverse = false; th.click(function(){ user_table.find('td').filter(function(){ homecoming $(this).index() === thindex; }).sortelements(function(a, b){ homecoming $.text([a]) > $.text([b]) ? inverse ? -1 : 1 : inverse ? 1 : -1; }, function(){ // parentnode element want move homecoming this.parentnode; }); inverse = !inverse; }); });
thx
the problem have you're getting javascript error: uncaught typeerror: object [object object] has no method 'sortelements'
you need include external library: https://github.com/padolsey/jquery-plugins/blob/master/sortelements/jquery.sortelements.js
so, need is, download .js file , reference on page after
jquery script reference, e.g.:
<script type="text/javascript" src="https://raw.github.com/padolsey/jquery-plugins/master/sortelements/jquery.sortelements.js"></script>
see jsfiddle fixed here: http://jsfiddle.net/daqgc/3/
jquery
No comments:
Post a Comment