Search
11152 results 1221-1230
Forum
- 19th Jul 2013Where do i download the plug-in that will help sort a column of strings as an integer sort???The code is there on the page. To create a file with the code in it just create a new file in your text editor and paste it :-). I'll be adding a download option soon, but I was thought it was a bit unnecessary. For how to implement - see: http://datatables.net/release-datatables/examples/plug-ins/sorting_sType.html Allan
- 4th Jun 2013Sort column with Date day/month/yearresolved! [code] jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a,b) { var ukDatea = a.split('/'); var ukDateb = b.split('/'); var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; return ((x < y) ? -1 : ((x > y) ? 1 : 0)); }; jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) { var ukDatea = a.split('/'); var ukDateb = b.split('/'); var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; return ((x < y) ? 1 : ((x > y) ? -1 : 0)); }; [/code]
- 21st Mar 2013Break on column, need custom sort or fnDrawCallback?I ended up writing a plugin to do this but then decided it wouldn't be that beneficial since the way the table i'm using this for would make it where you don't know which group the record is for. It would be better to use column grouping in this case, but for my requirement, I cannot do this so I am leaving it as is.. Here is what i was playing with.. [code] function breakOn(sort_name){ var base = ""; $.fn.dataTableExt.afnSortData[sort_name] = function ( oSettings, iColumn ) { var aData = []; $( 'td:eq('+(iColumn)+')', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () { if(base != $.trim($(this).text()) && $.trim($(this).text()) != "" ){ base = $.trim($(this).text()); } aData.push( base ); } ); return aData; } } //i may have multiple columns that was like this so I made it into a function //I then added a sSortDataType :'break-on' in the DT setup call. breakOn('break-on'); [/code] Just wanted to post what i was working with just in case it would help someone in the future.
- 16th Mar 2013Inline Edit Data Not Retained After Subsequent Filter or Sort[NOTE: I have reposted with question as a new entry, since it really deals with a different topic] http://datatables.net/forums/discussion/14646/fngetposition-returns-cannot-read-property-ntr-of-undefined-when-called-on-table-w-fixed-cols After some further research, it appears that the use of the Fixed Columns feature is a contributor to this problem. [code] new FixedColumns(oTable,{"iLeftColumns":6,"iLeftWidth":500}); [/code] When referencing columns on the right side of the split, the following lines work: [code] var oTable = $('#mtTable').dataTable(); var aPos = oTable.fnGetPosition(this); oTable.fnUpdate(sValue,aPos[0],aPos[1]); [/code] But, the first column on the right side has an index of zero. How would I access the columns on the left side of the split, perhaps a different table name in the "var oTable = " statement?
- 6th Mar 2013Sort columns with checkboxes(Multiple columns are generated dynamically)Anyone???
- 2nd Jan 2013aaSorting sort by associative key rather than index of arrayCurrently no - but it is coming :-). See: http://datatables.net/forums/discussion/comment/43404#Comment_43404 Allan
- 28th Dec 2012Sort by date - format = "02 November 2012"Since that isn't automatically picked up by Date.parse() you'd need a plug-in for it: http://datatables.net/plug-ins/sorting . There are lots of plug-ins available already ( http://datatables.net/plug-ins/sorting ), but not I think for that format. If you do create one, let us know and I'll add it to the list :-) Allan
- 10th Dec 2012Need to sort specific column in datatable.try to set up an example at live.datatables.net
- 6th Dec 2012Appendind element to table header th triggers sort each time I click on it?OK, That was quick :) added onclick='event.stopPropagation();' to select element... Is there any other way to achieve this ? (disable sorting when clicking on select or any other html element appended to the th?)
- 12th Nov 2012How to make first column is fixed for data table, and how to disable search & sort features in DT?To disable pagination, no of pages selection etc. use And bPaginate / bLengthChange . It sounds like FixedColumns is what you want. You say it didn't work for you, but in what way? Without an explanation (and a link) of what is no working we can't offer any help! Allan