Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all 1817 articles
Browse latest View live

Caption & Filter

$
0
0
Hi,
when using in conjunction with the filter option the table <caption> is rendered below the filter area; is there a way to adjust this and display above??
Here is the screenshot: http://i45.tinypic.com/2h2f9ua.jpg .
Thanx a lot

Danilo

IE8 Stop Script Pop up message

$
0
0
I keep getting the stop script message for my table when rows are around 1500 rows. I am using deferred rendering and turned off bsort (advice from other forum posts). Even when the Json data is cached I get that message. The thing is right after you click "No" the table appears and everything.

The odd thing is that when the cache is cleared it takes a lot longer before the stop script message pops up, this makes me assume it is not the data fetching causing the message. I could be wrong.

I can't really post a live working version of the table due to information legal tape, etc. but I will try to post what I can

Initialisation Options:
*i edited some parts to keep information private
{
    "bAutoWidth": false,
    "bStateSave": true,
    "bSortClasses": false,
    "bJQueryUI": true,
    "bProcessing": true,
    "aoData": [{}],
    "sScrollY": "375px",
    "sAjaxSource": "...........",
    "bDeferRender": true,
    "sAjaxDataProp": "invs",
    "aoColumnDefs": [{
        "fnRender": "function (oObj) {
    return \"<a href=\\\"\" + oObj.aData.invid + \"/investigators/\" + oObj.aData.inv.id + \"\\\" target=\\\"_blank\\\">\" + oObj.aData. + \"</a>\";
}",
        "iDataSort": 8,
        "aTargets": [0]
    }],
    "aoColumns": [{...column data...}],
    "bScrollCollapse": true,
    "sDom": "<\"class\"C>T<\"clear\">lrtipS",
    "oTableTools": {
        "sSwfPath": "https://website.com/swf/copy_csv_xls_pdf.swf",
        "sRowSelect": "multi",
        "aButtons": [{
            "sExtends": "copy",
            "bSelectedOnly": "true"
        }, {
            "sExtends": "csv",
            "bSelectedOnly": "true"
        }, {
            "sExtends": "xls",
            "bSelectedOnly": "true"
        }, {
            "sExtends": "text",
            "sButtonText": "Select Visible",
            "fnClick": "function (nButton, oConfig, oFlash) {
    var oTT = TableTools.fnGetInstance(\"sort_table\");
    var data = oTable.$(\"tr\", {filter: \"applied\"});
    for (var i = 0; i < data.length; i++) {
        if (!oTT.fnIsSelected(data[i])) {
            oTT.fnSelect(data[i]);
        }
    }
}"
        }, "select_none",
        {
            "sExtends": "csv",
            "sButtonText": "Export All Investigators",
            "bSelectedOnly": "none"
        }]
    },
    "oColVis": {
        "bCssPosition": true,
        "sSize": "css",
        "aiExclude": [0, 1, 8],
        "fnStateChange": "function () {
    oFC.fnUpdate();
    var h = $(\".dataTables_scrollHeadInner tr.ntrow\").height();
    $(\".DTFC_LeftHeadWrapper tr.ntrow\").css(\"height\", h);
    redraw_st();
}"
    },
    "sScrollX": "1600px",
    "iDisplayLength": -1,
    "aLengthMenu": [
        [-1],
        ["All"]
    ],
    "sPaginationType": "full_numbers",
    "fnInitComplete": "function () {
    oTable.fnAdjustColumnSizing();
    $(\"#sort_table\").hide();
    $(\"#sort_table\").hide();
    $(\"#sort_table\").show();
    $(\"#sort_table\").show();
}",
    "fnRowCallback": "function (oSettings) {
    $(\"#sort_table\").hide();
    $(\"#sort_table\").hide();
    $(\"#sort_table\").show();
    $(\"#sort_table\").show();
}"
}

Any advice or help will be greatly appreciated. I just want the error message to stop appearing or to just some how make it automatically be clicked to No.
If more information is needed I will be happy to provide what I can give out
Thanks in Advance

Why are my fields behaving strangly with multiple table in same view?

$
0
0
Hi, I’m sing three jquery datatables in the same view of mt asp.net- mvc application. When my user clicks on an option in the first table the second table appears. Clicking on an option in the second table makes the third table appear.



My problem happens when I try to use the filter fields that are in the <tfoot> element of the first table when the other tables are not loaded. I get this error message.



Microsoft JScript runtime error: Unable to get value of the property 'oApi': object is null or undefined.



Upon checking the jquery.dataTable.columFilter.js file I found the problem here:

function _fnColumnIndex(iColumnIndex) {

if (properties.bUseColVis)

return iColumnIndex;

else

return oTable.fnSettings().oApi._fnVisibleToColumnIndex(oTable.fnSettings(), iColumnIndex);

//return iColumnIndex;

//return





It seems the problem is with this line:

return oTable.fnSettings().oApi._fnVisibleToColumnIndex(oTable.fnSettings(), iColumnIndex);





If the other tables are loaded I can use the filter fields on the first table but only if the other tables are loaded too.



Any ideas how I can solve this problem.

Problem with fnAddData and hidden column

$
0
0
I have a table with 10 column, and 2 of it are hidden. When I try to add a new row with fnAddData() it adds the new row, starting from the first shown column. Here is the code I'm using

                   oTable.fnAddData( [
                        "1.1",
                        "1.2",
                        "1.3",
                        "1.4",
                        "1.5",
                        "1.6",
                        "1.7",
                        "1.8",
                        "1.9",
                        "1.10" ]
                    );

1.1 and 1.2 show be hidden, but when the function is executed, 1.9 and 1.10 goes into NEW columns at end of the table... What can I do?

Table Width Adjustment

$
0
0
I tried searching for this in this forum, but couldn't find any solution. Here's what I am looking for:

Is there a way for DataTables to adjust it's width based off number of columns dynamically without taking up entire space (width="100%") ? For example, if my DataTable has 2 columns, I expect table to have shorter width. Currently, it is taking up enite white space and making it one big table with two columns separated widely. I tried setting "bAutoWidth": false, but to no avail.

Basically, I expect DataTable to adjust dynamically based on numbers of columns without specifying any set width.

Thanks!

Mismatch in the number of fields

$
0
0
I am fetching data from a PHP Backend using the fnServerData option. For some reason, while drawing the table, one more column is being expected. I get this popup: "DataTables warning (table id = 'summary'): Requested unknown parameter '13' from the data source for row 0". I just have 13 columns so parameter 13 shouldn't even be there. After investigating further, I saw that before sending the data to fnCallback there were 13 fields for every row and on returning there were 14. Any ideas regarding what I could be doing wrong?

          "fnServerData": (sSource, aoData, fnCallback) ->
            $.getJSON(sSource, aoData, (json) ->
              for data in json.aaData
                len = data.length
                console.log len //output 13
              fnCallback(json)
            )
            "fnDrawCallback": (oSettings) ->
            table = that.$("#summary").dataTable()
            cols = table.fnSettings().aoColumns.length
            console.log cols  //output 14
            col = 0
            while col < cols
              if that.shownFields.indexOf(col) == -1
                table.fnSetColumnVis(col, false)
              else
                table.fnSetColumnVis(col, true)
              col++

variable shownfields has been initialized with [0,1,2,3,4,5,6]

mRender is not working

$
0
0
I have jquery datatable (http://datatables.net) and want to create custom filter which excludes content inside any html select element. Following is the code I have written but its not working:-
$('.dataTable_exportable').dataTable( {
                                        "sDom": 'Tlfrtip',
                                        "bAutoWidth": true,
                                        "aoColumnDefs": [ { "aTargets": [12], "mRender": function(data, type, full) { return data.replace(/<select\b[^<]*(?:(?!<\/select>)<[^<]*)*<\/select>/gi, ""); },  "sType": "comments" } ]
});

where 12 is the number of column which contains that select boxes starting from 0.

But it still taking the complete content of cell include select html field into search. Can anyone suggest why this code is not working ?

Proof that regex I used in replace is working correctly- jsfiddle.net/QubMc

Uncaught TypeError: Object [object Object] has no method 'charCodeAt'

$
0
0
Hi Allan,

Since the update to 1.9.3 I am receiving the following error:
Uncaught TypeError: Object [object Object] has no method 'charCodeAt' on line 3841.

I have uploaded debug info. code: ekazek

Many thanks

Steve

ColReorder and ColVis is not working on refreshing a row?

$
0
0
Hi, straight forward to the problem:
i have a dataTables which works awesome, FIY i have it reorder my json and populate my table. some of the columns would be hidden(off) during intialization with colviz the problem begins here:
when i update a row with fnRowCallback it loads but not in the expected order which should be called by ColReorder and ColViz.
and it scrambles all my work
can anyone help?

POST data disappearing

$
0
0
I'm trying to POST back to my server to save edits. I use the method listed here:

http://www.datatables.net/release-datatables/examples/api/form.html

The problem is I'm only getting the first page of data, not the whole thing. I can see that sData has all the serialized data correctly (thank you FireBug), but, something is happening from that point to the point where I grab the $_POST data on the page reload.

I'm thinking it has something to do with the way I'm displaying my input fields, I'm hoping someone would have a suggestion on how I handle this.

I'm building my initial table by querying my database and building the table as follows:

<head>
$('#product_grid_form').submit( function() {
	var sData = oTable.$('input').serialize();
} );

var oTable = $('#product_grid').dataTable();
</head>
...
<form id="product_grid_form" method="post" action="thispage.php" name="product_grid">
<table id="product_grid" style="width:100%;">
<thead>
	<tr>
		<th>column header</th>
		...
		...
	</tr>
</thead>
<tbody>
<?php
$results = mysql_query("SELECT * FROM example")
while ($row = mysql_fetch_array( $results );) {
<tr>     
	<td><input type="text" value="<?=$row['name']?>" name="<?=$row['name'].$row['id']?>"></td>
	<td><input type="text" value="<?=$row['size']?>" name="<?=$row['size'].$row['id']?>"></td>
	...
	...
</tr>
}

?>
</tbody>
</table>
</form>

Is this because I have live input elements on the page they are overriding the sData passed by Datatables? Is there a way around this?

The only thing I found that may work is the jQuery post method

$('#product_grid_form').submit( function() {
	var sData = oTable.$('input').serialize();
	$.post("save_sdata.php", sData, function(){ alert('success!'); });
	return false;
} );

If I am understanding this correctly the page would not reload, this would just push the data to the "save_sdata.php" page.

Any suggestions would be appreciated.

Customization of filters in many tables in the same page

$
0
0
I'm using 3 tabs and i have table in each tab.

strange line - offset in my table

jquery 1.9 support

$
0
0
Hi All,

Is jquery 1.9 supported in the latest version of version of DataTables?

Cheers,

Andrew

German Translate

$
0
0
Hello,

i want to translate words like 'search', 'first', 'next', ... translate into german. But i dont know where i should search.
Did you know in which lines i have to search?

Thanks for help

Server side filtering error

$
0
0
Hello guys,

I've got a problem using DataTabvle 1.9. I've created the server side script in php with all the filter operations,and the ajax interaction with the table. When I first load the page the Table correcty populate itself with all the data.
When I insert a search string the table show the "processing" message but nothing happens. I've checked server side and the query is correct, also the json data in output seems corrected filtered.

Someone can give me some advice?

Thank you very much

Alessandro

updating rows after table is done drawing.

$
0
0
so i have a table that some language needs to be replaced from English to other language (and some other HTML tweaks).
I use jQuery for that and find the appropriate columns to update. however, to permanently update the content, i need to call fnUpdate (otherwise sorting, filtering, etc, will overwrite my changes)


$('#tf2_table_ss > tbody').find('tr').each(function() 
{ 
	cell_found = $(this).find('td.tf2-ss-c15');
	oTable.fnUpdate('new language', oTable.fnGetPosition(cell_found.parent().get(0)), 3);
});


however, fnUpdate will call fnDrawCallback and thats where i put my code in (i cannot put it into fnInitComplete because then oTable does not exists just yet)

is there any way to one-time update table AFTER its been created using fnUpdate (or is there better way?)

OR the values enter in the filter box instead of AND

$
0
0
Hello:

Like the tittle says, I would like OR the values on the search box instead of AND'ing them. Any hints would be greatly appreciated!

Unknown Parameter 0

$
0
0
Hello,

I'm receiving the "Unknown Parameter 0" error, however I don't get the error on the first initialization. My document can contain multiple datatables, however this particular page only has one.

Here is my debug data: http://debug.datatables.net/anusic

I have a dropdown one of the columns. When the dropdown changes, the onchange event is fired. Here is where I get the error:

$(document).off("change", '.companyContact');
$(document).on("change", '.companyContact', function (e) {
var oTable = $(this).parents('table').dataTable();
});

Thanks for any guidance.

jquery 1.9 support on FixedColumns

$
0
0
The FixedColumns package throws some errors with Jquery 1.9 -- will this be updated soon?

JEditable

$
0
0
Ok - so... I thought I had everything set up correctly, but, alas, there are some things not working.

I have a data table that is being populated by ajax... basically I'm writing the shell of the table and then using datatables with ajaxsource to take that table and populate it.

I'm also trying to do jeditable inline editing. Most of this works. I can get a field to update just fine.

My problem is with selects and populating them.

I call a function which takes some variable data and I create the aocols object through a loop... That's all, seemingly irrelevant.


var aocols = [];   
	 
	for(i=0; i < classes.length; i++){
		var addclass = ''; 
		
		var tmp = false;
		var fieldopts = false;  
		var lurl = ''; 
		var ltype = ''; 
		var sURL = ''; 
		var cname = '';
		var dt = ''; 
		
		if(fieldoptions[i]){
			tmp = fieldoptions[i].split(";"); 
		
		 
			if(tmp.length > 0){
				fieldopts = true;
				
				ltype = tmp[0]; 
				lurl = tmp[1]; 
				sURL = tmp[2]; 
				cname = tmp[3]; 
				 
			}    
		}
		
		
		
		var lt = 'GET'; 
		
		
		
		if(classes[i]){
			addclass = " "+classes[i]; 
		} else { 
			addclass = ''; 
		}
		
		if(lurl == "YESNO"){
			dt = "{'':'Please select...', '1':'Yes','0':'No'}";
			ltype = "select";  
		}
		
		
		if(ltype == ''){
			ltype = 'text'; 
		}
		
		if(sorts[i] == 'false'){
			if(fieldopts){
				
				var obj = { sClass: defclass+addclass, bSortable: false, sUpdateURL: sURL, loadtype: 'GET', loadurl: lurl, type: ltype, columnName: cname, data: dt};
			} else { 
				var obj = { sClass: defclass+addclass, bSortable: false };    
			}
			 
		} else { 
			if(fieldopts){
				var obj = { sClass: defclass+addclass, sUpdateURL: sURL, loadtype: 'GET', loadurl: lurl, type: ltype, columnName: cname, data: dt };
			} else { 
				var obj = { sClass: defclass+addclass };    
			}
				 
		}
		
		
		aocols.push(obj); 
	}
	
	
	
	//alert("index.php?option=com_crsmgr&controller=dashboard&type=json&task=" + ttitle + addVars); 
	var myDTable = jQuery('#'+tablename).dataTable( {
			bJQueryUI: true,
			"aaSorting": [],
			"iDisplayLength": 15,
			"aoColumns": aocols,
			"sPaginationType": "full_numbers",
			"bPaginate": true,
			"bFilter": true,
			"bInfo": true,
			"bProcessing": true,
			"bSort": true,
			"bServerSide": true,
			"sAjaxSource": "index.php?option=com_crsmgr&controller=dashboard&type=json&task=" + ttitle + addVars,
			"fnInitComplete": function(){ 
				 
			},
			"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
				// assuming ID is in column 0
				jQuery(nRow).attr("id", aData[0]);
				return nRow;
			}
	}).makeEditable({
		
		sUpdateURL: "index.php?option=com_crsmgr&controller=fieldupdates&task=updateRecord&type="+utype
	});  

The specific issue I'm having is that some of these fields are set to be type: 'select' , yet, no select is showing up when I click on the field. Just a regular text box shows up.

Also - I've tried putting aocols in the .makeEditable portion of the code - however - that yields me an $.editable.types[settings.type] is undefined.

So - I'm scratching my head wondering exactly what I'm doing wrong to not be able to populate the fields with selects vs text.

Any help would be appreciated!
Viewing all 1817 articles
Browse latest View live