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

Setting row id field

$
0
0
Hi,

Is there a way in the options of DataTables to set which field returned by the server is going to be used as the row id? I know DataTables uses DT_RowId as the default field, but would like to use a different field and cannot change response from server at this time.

Thanks.

DataTables with sScrollY

$
0
0
Hello,
I having a problem with adding a vertical scroll, It works fine in firefox, Chrome, Safari but on IE the columns width of the header do not match the columns width of each row.

I am using version 1.9.4. Is anybody having the same problem with IE(try it on IE8 and 9). Is there a way to fix it?

Thanks

Github like UI, one Ajax call to fetch some colums then second call to fill in other columns

$
0
0
Hi,

a non-standard scenario, probably most easily explained by taking the Github.com UI as an example. When you visit a Github repository you get a list of files and then the UI is updated with the commit data (e.g. date and comment) for each file, asynchronously.

I'd like to do something similar with datatables, there are some columns that I can pull out from the database very quickly and I'd like them to be displayed in the table immediately (or as quickly as an AJAX call can be). Once these easily found columns are displayed then I'd like to get the more complex and calculation intensive columns from the database and display them in the table via a second AJAX call.

Has anyone done anything like this already?

iDeferLoading Client Side support?

$
0
0
Is it possible that the iDeferLoading setting will get Client Side support in the future? I'm getting around it right now by pointing sAjaxSource to a dummy function that returns no records, then using the fnReloadAjax() method to point to the real function that returns data when a Search button is clicked. It works, but I feel like I'm being "clunky" with that dummy function.

Fixed width issue, checkbox column collapse issue

$
0
0
Hey,

I'm using datatables 1.9, and using the fixed table layout property. In chrome and Safari, the checkbox column is collapsed and merged with the next column. I tried to use it on the datatables samples. Here's the example, works well in firefox, but messed up in chrome and safari.

http://bufle.com/dtable/examples/basic_init/zero_config.html

sScrollY creates double <thead> and cols are misaligned

$
0
0
I use this code to generate my table
$('#myTable').dataTable( {
  "bPaginate": false,
  "bLengthChange": false,
  "bFilter": false,
  "bSort": false,
  "bInfo": false,
  "bAutoWidth": false,
  "bDestroy": true,
  "sDom": 'T<"clear">t',
  "sScrollY": "500",
  "oTableTools": {
  "sSwfPath": base_url+"js/swf/copy_csv_xls_pdf.swf"
 }
} );
The problem is that the generated <th>s are of different sizes respect to the corresponding <td>s
looking at the source code I've noticed that there are two divs, one is "dataTables_scrollHeadInner" and it contains a table which contains my original <thead> and <th>s, the other is dataTables_scrollBody and it contains a table with an empty <thead> with right size <th>s and a <tbody> with all my data.
I'm using the last version of dataTables (1.9.4).

Here a snapshot http://www.makerfaire.it/etc/datatables_error.png

Any hint?
thank you in advance

problem with datatable for gridview in asp.net

$
0
0
hello, i am unable to use data table jquery for gridview in asp.net. i am not understanding how to use data table. Please help me..

fnScrollDraw slow in IE, possible fix inside

$
0
0
Using DataTables 1.9.4:

One of our tables was taking between 3-7 seconds to load in IE, and through the profiler we traced it down to css.get([width or height]) calls happening within fnScrollDraw (taking about 70% of the draw time). I found that $(nSizer).width() was being called in multiple places and simply preassigned it to a variable, which dropped the time for this issue from 3-6 seconds to 200ms.

Is there a reason why $(nSizer).width() needs to be calculated separately for each child? Our table still looks the same, but I want to make sure.

Thanks.

How to access data Object

$
0
0
Hi,

How can I access the columns full mData when a table is setup like below:


var columns = [ { mData: dynamic.title } ];
var data = [ { dynamic: {title:'Test', desc: 'description', value3: 'val3' } } ];


$('#table').dataTable( {aaData: data, aoColumns: columns, fnCreatedCell: function(nTD,sData,oData,iRow,iCol){
alert( sData ); //Shows "Test"

//How can I get the whole object?
// { dynamic: {title:'test', desc: 'description', value3: 'val3' }


} });

export the data from table

$
0
0
Dear Everyone,

I am using Data Tables and putting data in to table is there any way to export that data into Excel,PDF or any format.

Please anyone help me online.

Thanks and regards,
Gajanan Hiroji.

Requested unknown parameter '_id' from the data source for row

$
0
0
Hi,

Using sAjaxDataProp:"" in our dataTable. Works well for loading data through ajax.

Also using editor to interact with a REST api. Delete works well, but Create does not. Depending on how settings are set and data is returned from the server, we either get a "Requested unknown parameter '_id' from the data source for row" error message if we return created row using aaData or directly (as shown in example below) (property "_id" *is* in the data) or a "Uncaught TypeError: Cannot read property 'length' of undefined" if we only return something like 'true'.

Any idea what's wrong?

datatable:
			$(document).ready(function() {
				var editor = new $.fn.dataTable.Editor( {
					"ajaxUrl": {
						"create": "POST http://mydomain/api/site",
						"remove": "DELETE http://mydomain/api/site/_id_"
					},
					"domTable": "#table_sites",
					"dbTable": "sites",
 					"fields": [
						{
							"label": "{{col_name}}",
							"name": "name",
							"type": "text"
						}
					]
				} );

				$('#table_sites').dataTable( {
					"sDom": "<'row-fluid'<'span4'l><'span4'T><'span4'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
					"bProcessing": true,
					"sAjaxSource": 'http://mydomain/api/site/list',
					"sAjaxDataProp": "",
					"fnCreatedRow": function( nRow, aData, iDataIndex ) {
						$(nRow).attr('id',aData["_id"])		//need this because server side data does not return DT_RowId
					},
					"aoColumnDefs": [
						{ "aTargets": [0], "sTitle": "{{col_id}}", "mData": "_id" },
						{ "aTargets": [1], "sTitle": "{{col_lang}}", "mData": "lang" },
						{ "aTargets": [2], "sTitle": "{{col_theme}}", "mData": "theme" },
						{ "aTargets": [3], "sTitle": "{{col_name}}", "mData": "name" },
						{ "aTargets": [4], "sTitle": "{{col_type}}", "mData": "type" },
						{ "aTargets": [5], "sTitle": "{{col_version}}", "mData": "version" },
						{ "aTargets": [6], "sTitle": "{{col_created}}", "mData": "created" },
						{ "aTargets": [7], "sTitle": "{{col_modified}}", "mData": "modified" }
					],
					"oTableTools": {
						"sRowSelect": "single",
						"aButtons": [
							{ "sExtends": "editor_create", "editor": editor },
							{ "sExtends": "editor_remove", "editor": editor }
						]
					}
				} );
			} );


json returned on create:
{"name":"asdfasdfasdf2","type":"general","version":"1.0","theme":"client-planetebebe","created":1355865082,"modified":1355865082,"lang":"en-CA","_id":"ID:50d0dbfa3b8e77be4000000c"}

There is anyway or example for onClcik event function ?

$
0
0
Well first of all very good & use-full utility for data work best wishes for Data tables team ! :)

I have something that i want to perform on it but little bit confuse how i perform it kindly if you have any solution or example share with me

my problem is Is its possible i have 3 tab of data tables & in first one i have all the name of mobile phones , model , company & year now when i click on my mobile name the second tab is open with all the online shop those sale this mobile phone & in third tab auto fill with it specifications :)

maybe its confusing you let i share some attachment of picture to describe what i want :)

http://i50.tinypic.com/20tfgwg.jpg

if its possible in Data tables kindly let me now i feel it'll but i m stuck in the initial step :S

in place editor not working

$
0
0
I am trying to implement the datatable and inplace editor but somehow it does not work..
here is my code..

oTable = $('#resultTable').dataTable( {

"sScrollY": 300,
"sScrollX": '100%',
"bPaginate": false,
"bProcessing": true,
"bFilter": true,
"bSort": true,
"bInfo": false,
} );
oTable.fnSort( [ [0,'desc']]);


oTable.$('td').editable( '/home/admin/editResults.jsp', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px",
"width": "100%"
} );

this is all in a $(document).ready( function() { ....
block ..
I have a html table defined as

<div id="dataTables">
<div class="edit">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="resultTable">
<thead>
<tr>
<th>CODE</th>
<th>Name</th>
<th>DESC</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>


I can see the data in the table but cant edit it..
please gudie me if i am missing anything ..

how to center table on page

bRegex does not work with server side processing

$
0
0
Hello,

I don't now if I'm doing anything wrong but I'm trying to use bRegex in server side processing and it is not working. I have a definition like this:
"aoColumns": [
{ "mDataProp": "browser", "bRegex": true},
{ "mDataProp": "status", "bSortable": false },
{ "mDataProp": "version", "sClass": "vShow" }
]

And everything is working expect bRegexp. For bRegex it always sends false:

sEcho=2&iColumns=3&sColumns=&iDisplayStart=0&iDisplayLength=100&mDataProp_0=browser&mDataProp_1=status&mDataProp_2=version&sSearch=&bRegex=false&sSearch_0=firefox&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&iSortCol_0=1&sSortDir_0=desc&iSortingCols=1&bSortable_0=true&bSortable_1=false&bSortable_2=true

Is there a bug or I'm doing something wrong?

Thanks,
Cristina

Horizontal scrolling + ColVis issue

$
0
0
I've a table with content loaded via ajax with show-columns plugin.
live demo: http://tinyurl.com/bwbceb2

the headers cells are not aligned and if u try to show/hide columns or change their order the content overflows the table..
how can i solve this problem?

here is the snippet code about the table inizialitation:
$('#t1').dataTable({
"sAjaxSource": "array.txt",
"bDeferRender": true,
"sDom": 'C<"clear">lfrtip',
"sScrollX": "100%",
"sScrollXInner": "110%",
"bScrollCollapse": true});

maybe, by sDom, i can envelop the processing inside a div with overflow property setted up by css..could it work?

I mentioned this issue in another post, i'm sorry if this could be unfair but i really need urgent help!

Datatable : problem with get all selected checkbox even it is filter

$
0
0
Hello,
First, I want to said sorry for my english.
Second, I have one prolem with using checkbox on datatable, and need help.
The problem is like this:
- Assume that I have 100 rows in table and I have a checkBox in each rows.
- I have one checkbox for select all checkbox when I click it.
when I click select all the checkBox, i do selected all checkbox in row of table and then when I click submit button I can get all the selected checkbox. It is good.
- But If I click select all the checkbox, all the checkbox in row of table is selected and then I try filter on the search text box, I got only 10 rows and every checkbox is still selected, and the problem when I click submit button, I still get all the selected checkBox(100 of checkbox). what I want is I want to get selected checkbox that I had filter.



Thank you
Chamnan

fnServerData,bServerSide and sAjaxDataProp

$
0
0
Hi there,

I'm trying to use fnServerData to get around the cross-site scripting stuff, but dataTables is staying in 'processing' mode forever when I add it. FYI, bServerSide is set to false and sAjaxDataProp is set to empty. I can see that the API is being called properly, data is retrieved and fnCallback is even called, but there is something I am missing... Any help would be appreciated.

				$('#table_sites').dataTable( {
					"sDom": "<'row-fluid'<'span4'l><'span4'T><'span4'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
					"bProcessing": true,
					"sAjaxSource": 'http://mysite/api/site/list',
					"sAjaxDataProp": "",
					"fnCreatedRow": function( nRow, aData, iDataIndex ) {
						$(nRow).attr('id',aData["_id"])		//need this because server side data does not include DT_RowId
					},
					"fnServerData": function( sUrl, aoData, fnCallback, oSettings ) {
						oSettings.jqXHR = $.ajax( {
							"url": sUrl,
							"data": aoData,
							"success": fnCallback,
							"dataType": "jsonp",
							"cache": false
						} );
					}
				} );


returned from server :
[{"_id":"ID:50d214c23b8e77804000000d","name":"patati142","type":"general","version":"1.0","theme":"valencia-dark","created":1355945154,"modified":1355945154,"lang":"en-CA"},{"_id":"ID:50d214b83b8e77ac4100000a","name":"patati16","type":"general","version":"1.0","theme":"valencia-gray-black","created":1355945144,"modified":1355945144,"lang":"en-CA"},{"_id":"ID:50d212e73b8e77824000000c","name":"patati14","type":"general","version":"1.0","theme":"client-eiffelv2","created":1355944678,"modified":1355944704,"lang":"en-CA"},{"_id":"ID:50d2123e3b8e774b40000006","name":"patati13","type":"general","version":"1.0","theme":"client-ambassadeur","created":1355944509,"modified":1355944517,"lang":"fr-CA"},{"_id":"ID:50d2120d3b8e777e40000009","name":"patati12","type":"general","version":"1.0","theme":"client-createursaveurs","created":1355944460,"modified":1355944508,"lang":"fr-CA"}]

Saving and loading state on demande

$
0
0
I need to save state and load it back on demande.

For example: The user is satisfied with his column layout, filters and sorting and then decide to give a name to this state and save it. Now he needs to be able to bring this state anytime he wants or create others.

Is there a way to do that with dataTables?

pagination and Filter and lengths are not working in IE 8.

$
0
0
I really new to the data table i am writing a table that iterates over a data from the database , it works fine in Firefox, but it does not work in IE8
table grid works but the pagination and filter alignment is completely off, they are wrapping in to multiple lines

i did some research i think it has to do with " dataTables wrapper form inline" but i am not sure how to set this to IE8.


Please help me out.

Thanks
Nand
Viewing all 1816 articles
Browse latest View live