Search Results

Search found 165 results on 7 pages for 'datatables'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • Jquery DataTables server parameters

    - by Faton
    In jquery DataTables it is possible to add server parameters through the method fnServerData or fnServerParams : $("#myTable").dataTable({ "bServerSide": true, "sAjaxSource": contextApp, "fnServerParams" : function(aoData){ aoData.push("name":"paramName", "value":"paramValue"); } ) Is it possible to do the same thing through fnSettings method? For example : var myTable = $("#myTable").dataTable(); var oSettings = myTable.fnSettings(); //add server paramters to oSettings

    Read the article

  • Get row id datatables

    - by Syed Haider Hassan
    ok. i have searched the internet and tried many things but nothing seems to work for me.. i am now getting upset of this datatables. I found 1 way which some ppl on net says works for them and it is giving me strange problem. if you see the image, when i use the function fnGetPosition, it just cross out.. i don't know why other users over net have no issue on it.. All i am trying to get is FormID, if there is any other way please help me get the ID.

    Read the article

  • DataTables - Remove DataTables from HTML Table created in different JavaScript File

    - by Matt Green
    So I have a site I visit everyday for work. The DataTables implementation on this site is atrocious. The DataTable is applied to an HTML table that is generated when the page is rendered and then the DataTable is initialized on it. I figured this is great because I can create a little TamperMonkey script to remove the horrible DataTable and create one that functions how I need it to. The DataTable is created via inline Javascript at the end of the document body. I tried the following per the DOCs for the destory() method. // ==UserScript== // @name // @version 0.1 // @description Makes the Invoice Table more user friendly // @include URL // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require http://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.1/js/jquery.dataTables.min.js // @copyright 2014+, Me // ==/UserScript== $(function() { var t = $('#customer_invoices').DataTable(); t.destroy(); }); It does not "remove those enhancements and return the table to its original un-enhanced state, with the data shown in the table" as stated in the docs. It does not appear to do anything. I think it is either because the table has not been Datatable initialized yet, or that I am not able to access the original DataTable initialization in a different scope. Any help is greatly appreciated as this has me banging my head on the desk.

    Read the article

  • Cannot add DataTables.net javascript into Joomla 1.5

    - by mfmz
    I've been having this problem where i couldn't add Datatables.net javascript into my Joomla article. I have been trying to include it through Jumi. To say that my editor strips of the tag is somewhat not right as I have been able to execute Google Chart API in Joomla which also uses javascript. Any clue why? The code is as below : <link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script> <script type="text/javascript"> $(document).ready( function () { var table = $('#example').DataTable(); } ); </script>

    Read the article

  • jQuery Datatables throws error when dynamically created row headers

    - by JM4
    I am using the Datatables jquery plugin for one of my projects. For one in particular, the number of columns can vary based on how many children a consumer has (yes I realize normalization and proper technique would insert on another row but it is a client requirement). Datatables must be set up as such: <table> <thead> <tr> <th></th> </tr> </thead> <tbody> <tr> <td></td> </tr> </tbody> </table> my script starts out as: <table cellpadding="0" cellspacing="0" border="0" class="display" id="sortable"> <thead> <tr> <th>parent name</th> <th>parent phone</th> <?php try { $db->beginTransaction(); $stmt = $db->prepare("SELECT max(num_deps) FROM (SELECT count(a.id) as num_deps FROM children a INNER JOIN parents b USING(id) WHERE a.id !=0 GROUP BY a.id) x"); $stmt->execute(); $rows = $stmt->fetchAll(); for($i=1; $i<=$rows[0][0]; $i++) { echo " <th>Child Name ".$i."</th> <th>Date of Birth ".$i."</th> "; } $db->commit(); } catch (PDOException $e) { echo "<p align='center'>There was a system error. Please contact administration.<br>".$e->getMessage()."</p><br />"; } ?> </tr> </thead> In this manner, the final column headers can be 1 or 50 spots long. However, with this dynamic code in place, datatables throws the following error: ""DataTables warning (table id = 'datatable'): Cannot reinitialise DataTable. To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrive to true. Alternativly, to destroy old table and create a new one...ETC."' Yes I have set "bRetrieve" : true in the javascript above and that does not do the trick. If I remove the code above, the file "works" fine but it leaves off the necessary columns for my table. Any ideas? Displaying JS <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="../media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="../media/js/TableTools/TableTools.js"></script> <script type="text/javascript" src="../media/ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "../media/swf/ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> TOP piece of HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Home</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <style type="text/css" title="currentStyle"> @import "TableTools.css"; @import "demo_table_jui.css"; @import "jquery-ui-1.8.4.custom.css"; </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="js/TableTools/TableTools.js"></script> <script type="text/javascript" src="ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> <body bgcolor="#e0e0e0"> <div class="main"> <div class="body"> <div class="body_resize"> <div class="liquid-round"> <div class="top"><span><h2>Details</h2></span></div> <div class="center-content"> <div style="overflow-x:hidden; min-height:400px; max-height:600px; overflow-y:auto;"> <div class="demo_jui"><br /> <table cellpadding="0" cellspacing="0" border="0" class="display" width="100%" id="sortable"> <thead> <tr> <th>First Name</th> <th>MI</th> <th>Last Name</th> <th>Street Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>DOB</th> <th>Gender</th> <th>Spouse Name</th> <th>Spouse Date of Birth</th> <!-- this part is generated with the php, when removed, datatables works just fine with the rest of the page --> <th>Dependent Child Name 1</th> <th>Dependent Date of Birth 1</th> <th>Dependent Child Name 2</th> <th>Dependent Date of Birth 2</th> <th>Dependent Child Name 3</th> <th>Dependent Date of Birth 3</th> <th>Dependent Child Name 4</th> <th>Dependent Date of Birth 4</th> <th>Dependent Child Name 5</th> <th>Dependent Date of Birth 5</th> <th>Dependent Child Name 6</th> <th>Dependent Date of Birth 6</th> <th>Dependent Child Name 7</th> <th>Dependent Date of Birth 7</th> </tr> </thead> <tbody> <tr> ... UPDATE REGARDING COMMENTS/ANSWERS I have received a number of responses indicating the number of headers may not match the field count in the body. As I mention below, eliminating the php script below altogether would eliminate 5+ fields in the header and without question throw the count match off balance. This DOES NOT however cause an error and in fact "resolves" the issue in that datatables functions properly (even though there is NO header record for 5+ fields in the body.

    Read the article

  • datatables-multi-filter-select

    - by user1871603
    I am using the jquery plug-in datatables. I am using the feature, datatables-multi-filter-select on my website with php code. I want to move the drop down filter from the footer to the header like in the following example: http://www.datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/ Can anyone please update the following PHP code sample to accomplish this? Code: /** * Register necessary Plugin Filters */add_filter( 'tablepress_shortcode_table_default_shortcode_atts', 'tablepress_add_shortcode_parameters_multi_filter_select' );add_filter( 'tablepress_table_render_options', 'tablepress_set_table_foot_option', 10, 2 );add_filter( 'tablepress_table_js_options', 'tablepress_add_multi_filter_select_js_options', 10, 3 );add_filter( 'tablepress_datatables_command', 'tablepress_add_multi_filter_select_js_command', 10, 5 ); /** * Add "datatables_multi_filter_select" as a valid parameter to the [table /] Shortcode */function tablepress_add_shortcode_parameters_multi_filter_select( $default_atts ) { $default_atts['datatables_multi_filter_select'] = false; return $default_atts;} /** * Make sure that "table_foot" and "datatables_scrollX" are false, if "datatables_multi_filter_select" is true, * as the footer will be appended by the JS. Scrolling will not work with automatically added content */function tablepress_set_table_foot_option( $render_options, $table ) { if ( $render_options['datatables_multi_filter_select'] ) { $render_options['table_foot'] = false; $render_options['datatables_scrollX'] = false; } return $render_options;} /** * Pass "datatables_multi_filter_select" from Shortcode parameters to JavaScript arguments */function tablepress_add_multi_filter_select_js_options( $js_options, $table_id, $render_options ) { $js_options['datatables_multi_filter_select'] = $render_options['datatables_multi_filter_select']; // register the JS if ( $js_options['datatables_multi_filter_select'] ) { $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; $js_multi_filter_select_url = plugins_url( "multi-filter-select{$suffix}.js", __FILE__ ); wp_enqueue_script( 'tablepress-multi_filter_select', $js_multi_filter_select_url, array( 'tablepress-datatables' ), '1.0', true ); } return $js_options;} /** * Evaluate "datatables_multi_filter_select" parameter and add corresponding JavaScript code, if needed */function tablepress_add_multi_filter_select_js_command( $command, $html_id, $parameters, $table_id, $js_options ) { if ( ! $js_options['datatables_multi_filter_select'] ) return $command; $name = str_replace( '-', '_', $html_id ); $datatables_name = "DT_{$name}"; $command = <<<JSvar {$name} = $('#{$html_id}'), {$datatables_name} = {$name}.dataTable({$parameters}), {$name}_tfoot, {$name}_selects, ths = '<tfoot>';{$name}.find('thead th').each( function( i ) { ths += '<th>' + datatables_fnCreateSelect( {$datatables_name}.fnGetColumnData(i) ) + '</th>';} );ths += '</tfoot>';{$name}_tfoot = {$name}.append(ths).find('tfoot');{$name}_selects = {$name}_tfoot.find('select');{$name}_tfoot.on( 'change', 'select', function() { {$datatables_name}.fnFilter( $(this).val(), {$name}_selects.index(this) );} );JS; return $command;} (function($) {/* * Function: fnGetColumnData * Purpose: Return an array of table values from a particular column. * Returns: array string: 1d data array * Inputs: object:oSettings - dataTable settings object. This is always the last argument past to the function * int:iColumn - the id of the column to extract the data from * bool:bUnique - optional - if set to false duplicated values are not filtered out * bool:bFiltered - optional - if set to false all the table data is used (not only the filtered) * bool:bIgnoreEmpty - optional - if set to false empty values are not filtered from the result array * Author: Benedikt Forchhammer <b.forchhammer /AT\ mind2.de> */$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { // check that we have a column id if ( typeof iColumn == "undefined" ) return new Array(); // by default we only wany unique data if ( typeof bUnique == "undefined" ) bUnique = true; // by default we do want to only look at filtered data if ( typeof bFiltered == "undefined" ) bFiltered = true; // by default we do not wany to include empty values if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true; // list of rows which we're going to loop through var aiRows; // use only filtered rows if (bFiltered == true) aiRows = oSettings.aiDisplay; // use all rows else aiRows = oSettings.aiDisplayMaster; // all row numbers // set up data array var asResultData = new Array(); for (var i=0,c=aiRows.length; i<c; i++) { iRow = aiRows[i]; var aData = this.fnGetData(iRow); var sValue = aData[iColumn]; // ignore empty values? if (bIgnoreEmpty == true && sValue.length == 0) continue; // ignore unique values? else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue; // else push the value onto the result data array else asResultData.push(sValue); } return asResultData;}}(jQuery)); function datatables_fnCreateSelect( aData ) { var r = '<select><option value=""></option>', i, iLen = aData.length; for ( i=0 ; i<iLen ; i++ ) { r += '<option value="'+aData[i]+'">'+aData[i]+'</option>'; } return r + '</select>';}

    Read the article

  • How to display custom processing message in JQuery datatables

    - by Sukhi
    i am using datatables api to display data in my asp.net4.0 application; datatables I have one column [ Delete ] to delete the row data.when i click on this link i send a jquery ajax request to delete the row from database. I want to display a message such as [ Deleting record... ] to the end user until data deleted by server side processing. I put a div on my page and write a message [ Deleting record... ] in a div when i click on delete link i display that message but when delete operation complete it also display a message [ Processing... ](which is inbuilt message of datatables) which looks like odd as two message are displaying. What can i do better to display message to the end user. JSCode $('#tblVideoList .delete').live('click', function (e) { e.preventDefault(); var oTable = $('#tblVideoList').dataTable(); var aPos = oTable.fnGetPosition(this.parentNode); var aData = oTable.fnGetData(aPos[0]); if (confirm('Are you sure want to delete the record.')) { $("#divDelete").show(); var today = new Date(); $.ajax({ type: "GET", cache: false, url: "samplepage.aspx", success: function (msg) { $("#divDelete").hide(); oTable.fnDraw(); } }); } return false; }); Thanks

    Read the article

  • datatables.net plugin hides table behind left menu

    - by naveen
    I had a page that works perfectly in IE. Then I added the wonderful jQuery plugin datatables.net to it using this code in DOMReady with this code $('#articlestable-container table').dataTable({ "bPaginate": true, "bLengthChange": false, "bFilter": true, "bSort": false, "bInfo": false, "bAutoWidth": false }); Everything is fine in Webkit and Firefox browsers. See the image. But in IE, the table hides the menu that ideally should come over the table like this. As you can see, the sub-menu gets rendered behind the table. I don't think z-index is the culprit here. The sub-menu has z-index: 9999; anyway. What could be wrong? Any pointers to solve this will be very helpful.

    Read the article

  • Formatting a query to enumerate through 2 different datatables

    - by boiler1974
    I have 2 datatables sendTable and recvTable They both have identical column names and numbers of columns "NODE" "DSP Name" "BUS" "IDENT" "STATION" "REF1" "REF2" "REF3" "REF4" "REF5" "REF6" "REF7" "REF8" I need to compare these 2 tables and separate out the mismatches I only need to check Columns 3-11 and Ignore col 1 and 2 I tried at first removing the 2 columns and then loop thru row by row and return matches and mismatches but the problem with this approach is that I no longer have the "NODE" and "DSP Name" associated with the row when I finalize my results So I need help with a query Here is my attempt var samerecordQuery = from r1 in sendTable.AsEnumerable() where r1.Field<int>("BUS").Equals(from r2 in recvTable.AsEnumerable() where r2.Field<int>("BUS")) this obviously doesn't work so how do I format the query to say from r1 cols[3-11] equals r2 cols [3-11] and once I have this I can use the except to pull out the mismatches

    Read the article

  • Datatables pagination characters "<<" and "<" not displaying correctly in IE and Safari

    - by Jaaromy
    I'm using the DataTables jQuery plugin and am having issues with the First and Previous pagination links displaying correctly in IE and Safari (Firefox and Opera work). "<<" and "<" display as "<" and "". $(document).ready(function () { oTable = $('#fileList').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "oLanguage": { "sSearch": "Search all columns:", "oPaginate": { "sNext": '>', "sLast": '>>', "sFirst": '<<', "sPrevious": '<' } } }); I have attempted to escape '\<\<' to no avail. Any ideas?

    Read the article

  • datatables add combobox as a column

    - by user403295
    Hi to all, I have got a datatable (http://www.datatables.net/). I have created and filled the table as shown below. Now I need to implement a combobox (assume that I have got 2010, 2011,2012) to allow the user select a year . then when user clicks View or Modify link, which is placed in the table, selected year will be passed to another page as a parameter. Now how can I turn my year column into a combobox?Thanks. rulesTableGlobal = $('#rulesTable').dataTable( { //"bJQueryUI": true, "sPaginationType": "full_numbers", "aoColumns": [ { "sTitle": "Id", "sWidth" : "20px" }, { "sTitle": "Property ID" , "sWidth" : "20px"}, { "sTitle": "Adress" , "sWidth" : "130px"}, { "sTitle": "Suburb" , "sWidth" : "50px"}, { "sTitle": "Bond", "sWidth" : "25px" }, { "sTitle": "Year", "sWidth" : "25px" , "aType": "dom-select"}, { "sTitle": "View or Modify" , "sWidth" : "50px"}] }); function addPropertyToTable( lt_id, lt_uid, address, suburb_name, min_guests, max_guests, bondFee,cleaningFee,bookingServiceFee, weekly_rate,nightly_rate){ var _lt_id = "\'" + lt_id + "\'"; var viewLink = '<A href="#" onclick="forwardDetails('+_lt_id+');">View and Modify</A>'; var year= ""; $('#rulesTable').dataTable().fnAddData( [ lt_id, lt_uid, address, suburb_name, bondFee,cleaningFee,bookingServiceFee, weekly_rate,nightly_rate, min_guests, max_guests, year, viewLink ] ); } }); }

    Read the article

  • JQuery DataTables link item

    - by rogcg
    I'm trying to link the items from a specific column, but each one will be linked for a different id from the json string. Unfortunately I can't find a way to do this using the API (I know there is a lot of ways to do that without using the API ), but I'm looking for a way to link a item from a column (each one with a link for a specific id). So here is my code, I use getJSON to get the JSON from the server, and I load the data from this JSON to the table like this: $.getJSON("/method/from/server/", function(data) { var total = 0; $("#table_body").empty(); var oTable = $('#mytable').dataTable( { "sPaginationType" : "full_numbers", "aaSorting": [[ 0, "asc" ]] }); oTable.fnClearTable(); $.each(data, function(i, item) { oTable.fnAddData( [ item.contact_name, item.contact_email ] ); }); }); What I want to do, is for each row, link the contact_name to its id, which is also in the JSON, and can be accessed inside this $.each loop by using item.contact_id. Is there a way to do this using DataTables API, if yes, could you explain me and provide a good resource that will help me with this? Thanks.

    Read the article

  • How to sorting by Dates with DataTables jquery plugin?

    - by chobo2
    Hi I am using the datatables jquery plugin and want to sorty by dates. I know they got a plugin but I can't find where to actually download it from http://datatables.net/plug-ins/sorting I believe I need this file: dataTables.numericComma.js yet I can't find it anywhere and when I download datatables it does not seem to be in the zip file. I am also not sure if I need to make my own custom date sorter to pass into this plugin. I am trying to sort this format MM/DD/YYYY HH:MM TT(AM |PM) Thanks

    Read the article

  • jQuery Datatables and ColumnFilterWidget integration issue

    - by user3520135
    I am trying to Place the ColumnFilterWidget plugin in the Header of the Datatables Table. Here are the changes i made in it : /** * Menu-based filter widgets based on distinct column values for a table. * * @class ColumnFilterWidgets * @constructor * @param {object} oDataTableSettings Settings for the target table. */ var ColumnFilterWidgets = function( oDataTableSettings ) { var me = this; var sExcludeList = ''; // me.$WidgetContainer = $( '<div class="column-filter-widgets"></div>' ); me.$WidgetContainer = $( '<tr class="head"></tr>' ); me.$MenuContainer = me.$WidgetContainer; me.$TermContainer = null; me.aoWidgets = []; me.sSeparator = ''; if ( 'oColumnFilterWidgets' in oDataTableSettings.oInit ) { if ( 'aiExclude' in oDataTableSettings.oInit.oColumnFilterWidgets ) { sExcludeList = '|' + oDataTableSettings.oInit.oColumnFilterWidgets.aiExclude.join( '|' ) + '|'; } if ( 'bGroupTerms' in oDataTableSettings.oInit.oColumnFilterWidgets && oDataTableSettings.oInit.oColumnFilterWidgets.bGroupTerms ) { me.$MenuContainer = $( '<div class="column-filter-widget-menus"></div>' ); me.$TermContainer = $( '<div class="column-filter-widget-selected-terms"></div>' ).hide(); } } // Add a widget for each visible and filtered column $.each( oDataTableSettings.aoColumns, function ( i, oColumn ) { var $columnTh = $( oColumn.nTh ); var $WidgetElem = $( '<th><div class="column-filter-widget"></div></th>' ); if ( oColumn.bVisible && sExcludeList.indexOf( '|' + i + '|' ) < 0 ) { me.aoWidgets.push( new ColumnFilterWidget( $WidgetElem, oDataTableSettings, i, me ) ); } me.$MenuContainer.append( $WidgetElem ); } ); if ( me.$TermContainer ) { me.$WidgetContainer.append( me.$MenuContainer ); me.$WidgetContainer.append( me.$TermContainer ); } oDataTableSettings.aoDrawCallback.push( { name: 'ColumnFilterWidgets', fn: function() { $.each( me.aoWidgets, function( i, oWidget ) { oWidget.fnDraw(); } ); } } ); return me; }; I added a extra <tr class='head'> inside the Datatable, and later on i am trying to append the Filters to that with attached to them,But instead of that it is creating new TR tag and then appending the filters in it. I even changed my dom of data tables to : dom: '<"clear">Cf<"clear">ltWrip', So the table elements should be there so that it can insert filters inside the head.

    Read the article

  • jQuery DataTables server side processing and ASP.Net

    - by Chad
    I'm trying to use the server side functionality of the jQuery Datatables plugin with ASP.Net. The ajax request is returning valid JSON, but nothing is showing up in the table. I originally had problems with the data I was sending in the ajax request. I was getting a "Invalid JSON primative" error. I discovered that the data needs to be in a string instead of JSON serialized, as described in this post: http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/. I wasn't quite sure how to fix that, so I tried adding this in the ajax request: "data": "{'sEcho': '" + aoData.sEcho + "'}" If the aboves eventually works I'll add the other parameters later. Right now I'm just trying to get something to show up in my table. The returning JSON looks ok and validates, but the sEcho in the post is undefined, and I think thats why no data is being loaded into the table. So, what am I doing wrong? Am I even on the right track or am I being stupid? Does anyone ran into this before or have any suggestions? Here's my jQuery: $(document).ready(function() { $("#grid").dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bServerSide":true, "sAjaxSource": "GridTest.asmx/ServerSideTest", "fnServerData": function(sSource, aoData, fnCallback) { $.ajax({ "type": "POST", "dataType": 'json', "contentType": "application/json; charset=utf-8", "url": sSource, "data": "{'sEcho': '" + aoData.sEcho + "'}", "success": fnCallback }); } }); }); HTML: <table id="grid"> <thead> <tr> <th>Last Name</th> <th>First Name</th> <th>UserID</th> </tr> </thead> <tbody> <tr> <td colspan="5" class="dataTables_empty">Loading data from server</td> </tr> </tbody> </table> Webmethod: <WebMethod()> _ Public Function ServerSideTest() As Data Dim list As New List(Of String) list.Add("testing") list.Add("chad") list.Add("testing") Dim container As New List(Of List(Of String)) container.Add(list) list = New List(Of String) list.Add("testing2") list.Add("chad") list.Add("testing") container.Add(list) HttpContext.Current.Response.ContentType = "application/json" Return New Data(HttpContext.Current.Request("sEcho"), 2, 2, container) End Function Public Class Data Private _iTotalRecords As Integer Private _iTotalDisplayRecords As Integer Private _sEcho As Integer Private _sColumns As String Private _aaData As List(Of List(Of String)) Public Property sEcho() As Integer Get Return _sEcho End Get Set(ByVal value As Integer) _sEcho = value End Set End Property Public Property iTotalRecords() As Integer Get Return _iTotalRecords End Get Set(ByVal value As Integer) _iTotalRecords = value End Set End Property Public Property iTotalDisplayRecords() As Integer Get Return _iTotalDisplayRecords End Get Set(ByVal value As Integer) _iTotalDisplayRecords = value End Set End Property Public Property aaData() As List(Of List(Of String)) Get Return _aaData End Get Set(ByVal value As List(Of List(Of String))) _aaData = value End Set End Property Public Sub New(ByVal sEcho As Integer, ByVal iTotalRecords As Integer, ByVal iTotalDisplayRecords As Integer, ByVal aaData As List(Of List(Of String))) If sEcho <> 0 Then Me.sEcho = sEcho Me.iTotalRecords = iTotalRecords Me.iTotalDisplayRecords = iTotalDisplayRecords Me.aaData = aaData End Sub Returned JSON: {"__type":"Data","sEcho":0,"iTotalRecords":2,"iTotalDisplayRecords":2,"aaData":[["testing","chad","testing"],["testing2","chad","testing"]]}

    Read the article

  • jquery datatables add checkbox with ajax server side response

    - by dotneter
    I am using C# ASP .NET MVC and ajax calls. I am able to get the display of the table along with all features. But, I don't understand how do I add a checkbox and button. I have tried dom-checkbox as well but can't get it to work. Any help is appreciated. My code looks like this: $(document).ready(function () { $('#personTable').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "/Home/GetCustomData", "aoColumns": [ { "sSortDataType": "dom-checkbox", "sTitle": "Select", sName": "" }, { "sName": "ID", "sTitle": "ID" }, { "sName": "FirstName", "sTitle": "First Name" }, { "sName": "Email", "sTitle": "Email"}] }); }); My Html is : [table border="1" id="personTable" class="display"] [/table]

    Read the article

  • jquery dataTables plugin: dynamically modify ajaxSource

    - by Anthony Koval'
    hello! on my page i have dataTable, which was initialized with, for example, sAjaxSource url like "/api/reports". when we're doing sorting, filtering it appends to url additional query-keys. I want do add keys "date_from" and "date_to" to sAjaxSource url (date intervals could be changed after table initialization). is there any entry-point function, before table reload, so i can do there smth like: var oSettings = rtbl.fnSettings(); oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").text() + "&date_to=" + $("#date_to").text(); thanks for your help!

    Read the article

  • adding multiple rows to jquery Datatables dynamically

    - by arrowill12
    I am trying to add multiple rows at once to a jQuery Datatable. I would like to be able to create a string such as the one below and call a function to add these elements as rows in the table. Is there a function that will allow me to do this? var trString = "<tr class='custom class'><td></td><td></td></tr><tr class='custom class'><td></td><td></td></tr><tr class='custom class'><td></td><td></td></tr>" I have seen the fnAddData function but I would not be able to add my custom classes dynamically to the rows using that function. Also I have tried fnAddTr but I keep receiving an error saying my object does not have the method "getelementsByTagName" again, is there a function that will allow me to add a string of "" to a datatable?

    Read the article

  • TableTools only exporting single header row

    - by Rakeesh
    I am using the DataTable jquery plugin from: http://datatables.net/ I have a DataTable that has multi-row table header with colspan. Something like: <thead> <tr> <th>Level 1</th> <th colspan='2'>Level 1 - Item 1</th> <th colspan='2'>Level 1 - Item 2</th> </tr> <tr> <th>Level 2</th> <th>Level 2 - Item 1a</th> <th>Level 2 - Item 1b</th> <th>Level 2 - Item 2a</th> <th>Level 2 - Item 2b</th> </tr> </thead> However when I use the TableTools plugin to export then except for the "Print" option all the rest (Excel, CSV, Pdf etc) only has the "Level 2" header row and not the Level 1. Any suggestions on how to get it to export also Level 1?

    Read the article

  • Run SQL Queries on DataTables, or similar, in .Net, without an RDBMS

    - by FastAl
    I'd like to have a dataset or datatables, and be able to run SQL statements on them, without using any external RDBMS. For Example, to take take 2 datatables in a dataset and just join them outright with a SQL statement and Where clause, the result being a new datatable? For example if I have 2 datatables, named People and Addresses in a dataset (that I built using code, not getting from a database .. pardon the old fashioned Join syntax): dim dtJoined as DataTable = MyDataSet.RunSQLQuery ("Select * from People, Orders Where People.PersonID=Orders.OrdereID") Thanks

    Read the article

  • Combine two datatables in JSF 1.1

    - by johnbritto
    I have two datatables. One is to display names. Another contains three <h:selectOneMenu>. I want combine those two datatables. I don't know how to do it? Expected result: ----------------------------------------------- Datatable1 Datatable2 ----------------------------------------------- Lic Date month year Premium Date month year Test Date month year

    Read the article

  • How to change results per page value in datatables

    - by detj
    Datatables has an option to select the number of records shown per page. The default value starts from 10, 25, 50 and 100. How can I change it to start from 5 instead of 10? 10 records is a bit too much and takes a lot of space in my current design. Thanx! http://datatables.net/

    Read the article

1 2 3 4 5 6 7  | Next Page >