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

DataTable Json format error

$
0
0
Hi,

I have just downloaded DataTable, and modified the server_side.html and scripts/server_processing.php to display one of table from my server. However I got the Json format error even I used the JSONLint to check my Json data generated by server_processing.php with "valid json" as result.

On the other hand, I have followed the instruction to use DataTables debugger to debug my DataTable, please find the below link for your reference:
DataTables debug bookmarklet
Upload complete - debug code: ebojiv (view)

Link: http://debug.datatables.net/ebojiv

Thanks for your help in advance.

Bernard

Data table api is not working on table populated from xml

$
0
0
I populate the table from an XML file. The data is displayed in the table. But the datatable UI features have not effect on the table. Searching, Filtering and paging is not working. I can't seem to find an exact example to match what I am needing.
Thanks
pathakr

data tables

$
0
0
dear sir server processing process not working in codeigniter..

Server side custom paging

$
0
0
I have implemented the server side loading functionality of datatable in the ASP.net application.

Now i want to implement the server side custom paging and sorting as well.

i.e. to send the page no or start index of record, page size.

please let me know

sDom resets when using AJAX and multiple tables

$
0
0
Hi everyone

I've looked through the forum and haven't found anything similar to what I am experiencing right now (so far).

I want to use AJAX to load different tables formatted with DataTables in one page.

I have three div in my page (all loaded through AJAX from external pages):
- First one is my custom search box
- Second one is my first table (with length changing, table, pagination and information only)
- Third one is my second table (table only)

On the first load, everything is fine. But when I enter anything in the search box, the sDom of the second table is reset to the default one (with length changing, filtering, pagination, information)

Could someone help me find what I'm doing wrong?

Thank you

I've loaded a debug page and uploaded it to DataTables live.
Debug: http://debug.datatables.net/uwudun
Live: http://live.datatables.net/osokem/4

Adding animation to show more rows function

$
0
0
Hi -

How would I add a slideUp/slideDown animation to showing more/fewer rows in datatables? Below is my function for showing all (I am using a link to do so rather than the dropdown):

showAllRows = function() {
var oSettings = $('#theTable').dataTable().fnSettings();
oSettings._iDisplayLength = '-1';
$('#theTable').dataTable().fnDraw();
};

Chaining slideDown() to fnDraw() doesn't work.

Thanks!

How to get row index in mData

$
0
0
I am trying to replace all usage of fnRender/mDataProp with mRender/mData.
I am trying to render index of current row in first cell.
fnRender function takes parameter contains iDataRow/iDataColumn field that contains info about position of current cell.
How to get it using mData/mRender?

Inconcistent iDisplayStart value when bStateSave, bServerside, bPaginate

$
0
0
I am using bStateSave and bootstrap pagination with serverside data with DataTables 1.9.4. I initially load the table which has 1000 rows and I navigate to the last page which has row numbers 950 to 1000. Then on reloading the page with a different query which has only 500 rows, due to bStatesave, the iDisplayStart value remains 950 instead of beginning from 0.
So no data is displayed in the table and the info section of datatable says - "Showing 950 to 500 of 500 entries"

This is my initialization code.
var oTable = $('#sampleTable').dataTable({
"sScrollY":"500px",
"bProcessing":true,
"bServerSide":true,
"bStateSave":true,
"sDom":'Crtipl',
"sAjaxSource":"http://testing/test.htmlx",
"iDisplayLength":50,
"bPaginate":true,
"sPaginationType":"bootstrap",
"aoColumns": [
{"mDataProp": "id"},
{"mDataProp": function(source){
return "<pre>"+source.description+"</pre>"
}},
{"mDataProp": createdBy"}
],
"fnRowCallback":function(nRow, aData, iDisplayIndex){
$(nRow).on('click',$(nRow),function(){
console.log(aData);
document.location.href="edit.htmlx"
});
}
});

How to navigate to the first page and show 1-50 entries in this case ? bStateSave has to be true to save the column sorting information on reload.

Thanks,
Darsheet.

_fnAjaxUpdateDraw crashes on "var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );"

$
0
0
Hello,

I am sure this is something obvious, but I can't figure out what's going on. I am using a server side ajax datasource. If I have the server side method that returns some jsonp.

The datatable is set up like this (per http://datatables.net/release-datatables/examples/server_side/jsonp.html)

            oTable = $('#example').dataTable({
                "bServerSide": true,
                "sAjaxSource": url,
                "fnServerData": function (sUrl, aoData, fnCallback) {
                    $.ajax({
                        "url": sUrl,
                        "data": aoData,
                        "success": fnCallback,
                        "dataType": "json",
                        "cache": false
                    });
                }

When I load the page, the datatables scrip crashes because the following line results in an undefined aData object

var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );

(line 2037 of jquery.dataTables.js v. 1.9.4)

When the crash happens the value of the json parameter in the debugger is:
{"sEcho":1,"iTotalRecords":2,"iTotalDisplayRecords":2,"aaData":[["Vasya","Doer","1","1/1/0001"],["Petya","Boss","2","1/1/0001"]]}

Seems valid, right?

What am I doing wrong?

Thank you!
Daniel

add paging functionality to user define buttons.

$
0
0
when pressing html button (created by user ) need call pagination events. is it possible.

Jquery DataTable Zoom out issue in internet explorer 10

$
0
0
Jquery DataTable zoom out the Internet explorer in remove mechine, sometime the column header disapper, once click the column, the column appear immediately.

Appreciate, any one help on this issue.

DataTable jquery can not control the column header padding

$
0
0
DataTable jquery can not control the column header padding. Appreciate, any one help on this issue

DataTable Jquery provide 'sScrollX': '100%' and use for servier side ajax process, got exception

$
0
0
in Jquer dataTable use to process server side ajax, we could not able to provide 'sScrollX': '100%'. if we provide the 'sScrollX': '100%', value in the DataTable intialize we got the below exception

---------------------------
Message from webpage
---------------------------
DataTables warning (table id = 'DataTables_Table_0'): Cannot reinitialise DataTable.

To retrieve the DataTables object for this table, pass no arguments or see the docs for

bRetrieve and bDestroy
---------------------------
OK  
---------------------------

any one guide us, how to resolve the above issues.

Thanks in advance!

Selecting a row

$
0
0
Hi
I will like to selec one row of my table, I got the idea of the example of the selecting example, but it doesn't work.
This is my code
<script type="text/javascript" charset="utf-8" id="init-code">

var oTable;
$(document).ready(function() {
    oTable = $('#example').dataTable( {
        "bProcessing": true,
        "sAjaxSource": "tomacorrienteslist.jsp",
        "bFilter": false,
        "bSort": false,
        "bInfo": false,
        "bPaginate": false,
        
         "aaSorting": [[ 4, "desc" ]],
        "aoColumns": [
            { "mData": "codigo" },
            { "mData": "descripcion" },
            { "mData": "xbee_id" }
        ]

        
    } );
    
     $("#example tbody tr").click( function( e ) {
        if ( $(this).hasClass('row_selected') ) {
            $(this).removeClass('row_selected');
        }
        else {
            oTable.$('tr.row_selected').removeClass('row_selected');
            $(this).addClass('row_selected');
        }
    });
} );

</script>    
What's wrong?

After closing fancybox, how to reload new data for datatable, not reload the entire parent page?

$
0
0
I have a fancybox, it popup from a link on parent page. Content of fancybox is a form used to add new user.
I want when I press the button on the fancybox add new user, that user is updated to the database, popup closes, it will add data to the DataTable in my parent page.
My current way of doing that after the user added, popup closed and refresh the entire page, as data in Datatable will be updated.
Reference my current way: http://stackoverflow.com/questions/17606824/submit-form-on-fancybox-type-iframe-return-data-and-message-from-controller-to-p

But if the user data in user table more, then reload the entire page will slow performance. So I want to close the fancybox popup, then just reload the data in the DataTable only.

I'm newbie about php programming field. I also have recently started using DataTable, so not familiar with the technique of it. What is the source ajax, server side processing ... How can I distinguish this techniques?
I look forward to learning more techniques to handle DataTable, to be able to master it.
I'm using CodeIgniter.
So I'm very happy if you can show me how to do specific to my problem. As one such demo, thanks all.

i want to switch places of info and pagination

$
0
0
how can i switch the info to right and pagination to left? is it possible.

Language translate.

$
0
0
Hello!

How i can translate language of searchbar text, results, pagination buttons text , etc.. ?

thanks in advance !

p.s. - Awesome script !

How do I set the row height in dataTables

$
0
0
Actually, I am scrolling through the table but behaing in a wierd manner as the row are having different heights.
Can you please help me out.

Help with cell editing using fnCreatedCell and mData

$
0
0
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
// Construct input control for the cell
},
"mData": function (source, type, val) {
if (type === "set") {
// Grab the value from input control and set source variable appropriately
return;
}
else if (type === "display") {
// Whatever gets returned here replaces the input control created in fnCreatedCell
// The input control is already updated by this point... don't need to do anything
return what?
}
}


I'm using fnCreatedCell to construct an input control that when clicked displays a datetimepicker the user may edit the cell value with. Inside mData where type equals "set" I grab the new value from the control and set the "source"[columnIndex] variable so the internal value datatables has for the cell matches it's visual value. When the user picks a datetime using the datetimepicker it generates a callback to call fnUpdate with the new cell value so mData where type equals "set" gets called. works great. then mData gets called again but this time where type equals "display". this is where I'm unsure what to return... really i don't want the display to change at all because I've already setup the custom control in fnCreatedCell and the control is already updated. Am i going about this wrong?

DataTable html tag problem

$
0
0
I'm using datatable. But in my jsp page, I have these lines
<tr class="even">
<td id="TimerUpdateEditRadio"><input type="radio"
name="choose" class="radiostyle" /></td>
<td><a href="TimerScheduleAppStatus.html">APY02-20</a></td>
<td>JALRC002</td>
<td>28-Jun-2013 03:35</td>

<td>Jun22-30In.xls</td>
<td id="TimerUpdateEditRadio">Daily</td>
<td>Completed</td>
<td>InProgress</td>


</tr>
But, the datatable is showing the results when i type any characters within all the td elements
for eg: if i type input, the table will show all results as same instead of showing "no entries found"

How to overcome this problem of html tags.
Viewing all 1816 articles
Browse latest View live