Search
23531 results 2961-2970
Forum
- 1st Mar 2010Adding URL's to a column's resultsYes, fnRender should do it. Thank you.
- 16th Feb 2010multiple columns in thead and tfoot but a free form (one cell) tbodyOh I see... Sorry to say that DataTables doesn't support colspan (or rowspan) in the tbody... The reason being that it would make implementing any sorting and filtering rather difficult. I did have a hack for colspan kicking around a while ago - so it's sort of possible, but I've never thought of an elegant solution that I like. it would also mess up the column visibility options... Allan
- 27th Dec 2009How to do a custom filter on multiple columns on the tableThis looks like a duplicate to me: http://datatables.net/forums/comments.php?DiscussionID=1019 :-)
- 27th Dec 2009limit to edit on or several columns but not allHi valdezr, There shouldn't be anything special about Firefox on Linux :-). Are you initialising jEditable before DataTables or after? If before, then this should work fine, and a good test would be to remove the DataTables initialisation and see if the jEditable one has worked. If you are doing it the other way around, then you'll need to use fnGetNodes() - http://datatables.net/examples/advanced_init/events_post_init.html Regards, Allan
- 23rd Oct 2009Added data does not match columnsHi kellyjandrews, I presume you are using fnAddData somewhere? Could you possible include that code - or ideally a link showing the problem? Thanks, Allan
- 26th May 2009Sorting by something other than columns...Hi rickblalock, I'm not sure I quite get the question - isn't the th sorting vertical (i.e. column)? Although this form doesn't allow files to be attached, perhaps you could put your screenshot up on the web somewhere and post a link so we can see what you are looking for? Also, have you had a look at the fnSort() API function, can this help with what you are looking for ( http://datatables.net/api#fnSort )? Allan
- 9th May 2009No sorting for ordinal columnsThis isn't something which is built into DataTables, but could be done through a callback function. What to do is to use fnDrawCallback() ( http://datatables.net/usage#fnDrawCallback ) to renumber your ordinal column on each draw. To optimise this it would be good to check the value of aaSorting from the last draw against the current aaSorting value to see if the sorting has changed. In this way you can update the ordinal only if needed. Hope this helps! If you make any head way with this code, perhaps you could post it here? I'm sure others would find it useful as well! Regards, Allan
- 8th Aug 2021Multiple columns of bit data typeHello, I have multiple fields in Editor, which all have a data type of bit or Booleans: editor_0 = new $.fn.dataTable.Editor({ ajax: { url: "/api/dataSetComplete", }, table: "#dsAll", fields: [{ label: "Median", name: "A_Run_Proj_Input_Data.MedianIncluded", type: "select", options: { "Yes": true, "No": false } }, { label: "Shoulder", name: "A_Run_Proj_Input_Data.ShldIncluded", type: "select", options: { "Yes": true, "No": false } }, { label: "Ramp", name: "A_Run_Proj_Input_Data.RampIncluded", type: "select", options: { "Yes": true, "No": false } } ] }); It seems that these fields interfere each other by allowing only one to be 'true' at the same time. If one is chosen to be true the other fields two will become false automatically. Could anyone can explain why? Thank you, YL
- 5th Apr 2021Columns Filtering when column is array typeSure there is better way to do, but this work api.columns( FilterColumnList ).every( function () { var column = this; var select = $('<select><option value=""></option></select>') .appendTo( $(column.footer()).empty() ) .on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex($(this).val()); column .search( val ? '^'+val+'$' : '', true, false ) .draw(); } ); if ( $( column.header() ).hasClass( 'dt-render' ) ) { var cells = api.cells( null, this ); if ( Array.isArray( cells.data()[ 0 ] ) ){ // type array var sArr = cells.data(), dArr = []; // unique set of datas for ( var z=0; z < sArr.length; z++ ){ sArr[ z ].forEach( function( e ) { e = Object.values( e ); if( $.inArray( e[ 0 ], dArr ) === -1 ) dArr.push( e[ 0 ] ); }); } dArr.sort(function(a, b){ if (isNaN( a )) { var aa = a.toLowerCase(); var bb = b.toLowerCase(); } else { var aa = Number( a ); var bb = Number( b ); } if ( aa < bb ) { return -1; } else if ( aa > bb ) { return 1; } return 0; }) dArr.forEach( function ( d, j ) { var t = '<option '; if ( (d) ){ if (savedColumnsFilters){ if (savedColumnsFilters[column[0][0]].search.search.replace(/\\/g,"") == '^'+d+'$'){ t += "selected='selected' "; } } select.append( t + 'value="'+d+'">'+d+'</option>' ); } } ); } else { cells.render('display').unique().sort().each( function ( d, j ) { var t = '<option '; if ( (d) ){ if (savedColumnsFilters){ if (savedColumnsFilters[column[0][0]].search.search.replace(/\\/g,"") == '^'+d+'$'){ t += "selected='selected' "; } } select.append( t + 'value="'+d+'">'+d+'</option>' ); } } ); }; } else { column.data().unique().sort().each( function ( d, j ) { var t = '<option '; if ( (d) ){ if (savedColumnsFilters){ if (savedColumnsFilters[column[0][0]].search.search.replace(/\\/g,"") == '^'+d+'$'){ t += "selected='selected' "; } } select.append( t + 'value="'+d+'">'+d+'</option>' ); } }); } });
- 3rd Jan 2020How to fetch values from database only for particular columnsIn the below screenshot , I want to fetch values for column 2 and column 4 values to be fetched from database. The column 1 and Column 3 has to be hardcoded. How can I do this?