Search
23679 results 3091-3100
Forum
- 24th Aug 2012Custom DOM sort and hiding columnsI am using a custom sSortDataType to sort input:text fields in the table. I am using the example for dom-text from this site. That pretty much works as expected until I hide and then unhide the sorted column. Apparently DataTables take the data from the custom sort and inserts it into its backing store destroying the original data. Not intuitively obvious that sorting will erase data. Seems to me that the display cache and the sort cache, for a custom sort, should be separate elements. Any advice on how to overcome this limitation.
- 14th May 2012DataTables Column Filter Add-on with dynamic ColumnsI want to use this Add-On but it dosn't work! here is my code example!! [code] function CreateProductTable(TableHeader, ProductTable) { var aColums = []; var aVisible = []; var aColumnIndex = []; if (TableHeader != null) { for (var i = 0; i < TableHeader.length; i++) { var jColums = { sTitle: '', sType: '', bVisible: true }; jColums.sTitle = TableHeader[i].Parameter; var iDatenTyp = TableHeader[i].DataType; switch (iDatenTyp.toUpperCase()) { case "char": case "1": //is a character jColums.sType = ''; break; case "number": case "0": //is a number jColums.sType = 'numeric-comma'; break; } var sColVis = TableHeader[i].ColumnVisible; if (sColVis.toLowerCase() == "false" || sColVis == "0") { aColumnIndex.push(i); } //jColums.bVisible = false; aColums.push(jColums); } jQuery('#CPH_content_HF_HiddenColumns').val(''); jQuery('#CPH_content_HF_HiddenColumns').val(aColumnIndex); if (TableHeader.length != 0) { jQuery('#tableproduct').dataTable({ "sScrollY": "200px", "bJQueryUI": true, "bLengthChange": false, //show entries //"sDom": 'FT<"clear">lftFrip', // p = bPaginate, i = bInfo, t = , r = "iDisplayLength": 20, "bPaginate": true, //"sPaginationType": "full_numbers", "bProcessing": true, "bSort": true, "bFilter": true, "bAutoWidth": false, "bDestroy": true, "bInfo": true, "aaSorting": [], "aaData": ProductTable, "aoColumns": aColums, //dynamic TableHeader "oLanguage": {}, "aoColumnDefs": [ //{ "bSearchable": false, "bVisible": true, "aTargets": [9] } ], "fnRowCallback": function (nRow, aData, iDisplayIndex) { for (var i = 0; i < aData.length; i++) { jQuery('td:eq(' + i + ')', nRow).attr('id', 'CellIndex_' + i + '_RowIndex_' + iDisplayIndex); jQuery('td:eq(' + i + ')', nRow).parent().attr('id', 'RowIndex_' + iDisplayIndex); } return nRow; }, "fnDrawCallback": function (nRow, aData, iDisplayIndex) {//reinitialisierung von funktionen jQuery('#progressbar_table').hide(); initTableProductClick(); } }) .columnFilter({ ######################## here are the problems ############################# }); //TableHeader they are invisible / var oTable2 = jQuery('#tableproduct').dataTable(); for (var i = 0; i < aColumnIndex.length; i++) { var iCol = aColumnIndex[i]; var bVis = oTable.fnSettings().aoColumns[iCol].bVisible; oTable2.fnSetColumnVis(iCol, bVis ? false : true); } } } } [/code] Dosent understand what's wrong... please help me ...! Tank you Tank you ... best regards Alexander
- 21st Feb 2012data table shows no zeros in numeric columnsThere is some parameter that allows me to see the zeros? the td is 0.5 but the table shows me .5 !! appreciate the help
- 19th Jan 2012ColReorder doesn't like columns with no captionIf you have a column without a caption, the DIV inside the TH shrinks to nothing so you end up clicking the TH instead of the DIV. The following line in _fnMouseDown [code] var nThTarget = e.target.nodeName == "TH" ? e.target : $(e.target).parents('TH')[0]; [/code] will normally find the appropriate TH fine because jQuery's parents() function is case insensitive, whereas the comparison between nodeName and "TH" is case sensitive. And this becomes a problem when the DIV shrinks to nothing because of no caption and you click on the TH directly. The solution is simple: force the case to either uppercase or lowercase. I used lowercase because it's more consistent and I don't like my TH's shouting at me! :) Modified code: [code] var nThTarget = e.target.nodeName.toLowerCase() == "th" ? e.target : $(e.target).parents('th')[0]; [/code]
- 4th Jan 2012Headers don't align with the columns on IE7, IE8, IE9Tried to use dataTables 1.8.0 and 1.8.2 but they don't align well. Also setting variable column widths works well in FF, chrome, Safari but fails in IE. I'm not sure if this is a dataTable issue or the issue with CSS Styling. The js code - $(document).ready(function(){ $('#example').dataTable( { "sDom": '<"top"fl>rt<"bottom"ip><"spacer">', "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "sPaginationType": "full_numbers", "bSort" : false } ); });
- 14th Dec 2011Best way to add buttons in columns headers ?Hi, I'm trying to add a filter button next to the arrows which display sorting (I'm using jQueryUI mode) Currently, I'm doing it using the fnHeaderCallback: I add a div behind the DataTables_sort_icon span. I chose a div because adding a span mess up with the sort icon spans that datatables manage. However, I have problems with the layout, and I'm wondering if the approach I chose is right. Any suggestions, samples ? Thanks,
- 18th Oct 2011Columns destroyed, if I hide a field manually (but mColumns has it listened)I use a button to hide and show specific folders, let's call them "groupe" and "type". By standard "type" is visible and "groupe" is NOT visible. If I save the pdf on the standard-version, everything is correct. If I save the pdf and select before "groupe" to show it on the table, everything is correct. (it's not displayed on the pdf, but I havent's put this field into the "mColumns", so it's okay, that's not shown up) If I save the pdf and deselect before "type" to hide it on the table, the column-title "type" is missing on the pdf-document, but the fields are overwriting the following column. Furthermore in "mColumns" I've ordered to show this column "type" in the pdf-document. So 2 fields are in one column. Regards Sebastian
- 4th Aug 2011Removing first column's header "activecolumn" classHello I'm using a styled datatables component and would like to understand how datatables handles the active column state. Upon clicking a column header (other than the first) I'm running a script the removes the active column status from all column headers and assigns it to the clicked column header. However, the first column always get's the "activecolumn" class back after my script. Is there an API call that I could use to say which column is the active column? Taavy
- 2nd Aug 2011Adding rows with hidden columnsHello, I have a Datatable set up with a hidden column, when I add a row (fnAddData) it gives me an error (requested unknown parameter 5 from the source from row 1) How do I add the row accommodating the hidden column. Thanks, Cameron Anderson
- 28th Jun 2011wrong column headers and data in wrong columns on exportColumn headers and data are incorrectly exported. It goes wrong from column 2. Could it be because I have [code] < dl> and [/code] html in column 2 data? Any advice as to how I can get around this problem would be much appreciated.