Search
11152 results 1281-1290
Forum
- 10th Mar 2015how to sort the data which contains html(input,anchor,,"") data in dataTables(1.10.5)195 the sorting is happening with the first digit..i.e, here (195) its considering only '1'. please let me know the solution.
- 6th Jan 2015I'm having a problem changing the default sort order on a table.I've used the example from the documentation - $(document).ready(function() { $('#example').dataTable( { "order": [[ 3, "desc" ]] } ); } ); But it still the first column which is being sorted. any idea where I am going wrong?
- 22nd Nov 2014I can't use multi-column sortI am not sure where is my wrong and the following is my code: <script> $.ajax({ url: "https://tasks.inlogik.com/devtest/animals", dataType: 'jsonp', data: '', jsonp: 'callback', success: function (arr) { var head = "<thead><th>"+"Name"+"</th><th>"+"Type"+"</th><th>"+"Weight"+"</th><th>"+"Birthday"+"</th><th>"+"Horns?"+"</th><th>"+"Action"+"</th></thead>"; var body= "<tbody>"; for (var i in arr) { body += "<tr><td>" + arr[i].name + "</td><td>" + arr[i].type + "</td><td>" + arr[i].weight + "</td><td>" + arr[i].birthday+ "</td><td>" + arr[i].hasHorns + "</td><td>" + "Details" + "</td></tr>"; } body += "</tbody>"; var whole = head + body; document.getElementById("mytable").innerHTML = whole; }, error: function (jqXHR, textStatus, ex) { alert(textStatus + "," + ex + "," + jqXHR.responseText); } }); $(document).ready(function () { $('#mytable').dataTable({ columnDefs: [{ targets: [0], orderData: [0, 1] }, { targets: [1], orderData: [1, 0] }, { targets: [4], orderData: [4, 0] }] }); }); </script> And I've already add
- 23rd Sep 2014How to sort after submitproject, For my table sorting am I using an
- 10th Sep 2014Getting array with all rows after sortI am having trouble getting getting rows left incl. paging results. My code: var table = $('#List').dataTable({ "sDom": 'T<"clear">lfrtip', "oTableTools": { "sRowSelect": "single" } }); $('#testBtn').on('click', function () { var oTT = TableTools.fnGetInstance('List'); var leftRows = oTT.fnSelect(oTable.$('tr', { "filter": "applied" })); console.log(leftRows); }); I am using TableTools 2.2.3 Thanks...
- 22nd Aug 2014Not able to filter and sort columns using Json string from ajax source on ASPX pageHere's my java script: $(document).ready(function () { var table; $("thead input").keyup(function () { /* Filter on the column (the index) of this element */ table.fnFilter(this.value, table.oApi._fnVisibleToColumnIndex( table.fnSettings(), $("thead input").index(this))); }); $("thead input").each(function (i) { this.initVal = this.value; }); $("thead input").focus(function () { if (this.className == "search_init") { this.className = ""; this.value = ""; } }); $("thead input").blur(function (i) { if (this.value == "") { this.className = "search_init"; this.value = this.initVal; } }); table = $('#gridTable').dataTable({ "bPaginate": true, "bProcessing": true, "bServerSide": true, "bSortCellsTop": true, "sDom": 'T<"clear">Rlfrtip', "oLanguage": { "sSearch": "Pesquisar no resultado geral:" }, "contentType": "application/json; charset=utf-8", "sAjaxSource": "CustomerService.asmx/GetList", "fnServerData": function (sSource, aoData, fnCallback) { $.ajax({ "dataType": 'json', "contentType": "application/json; charset=utf-8", "type": "GET", "url": sSource, "data": aoData, "success": function (msg) { var json = jQuery.parseJSON(msg.d); fnCallback(json); $("#gridTable").show(); } }); } }); });
- 16th Aug 2014sort table by javascript eventa javascript function which sorts the table automatically. For
- 6th Aug 2014Possible to sort and highlight certain type of data?Hi everyone, I got a quick question about DataTables. I plan to create a table showing different telecomm data rates. One function i like to the table to have is the ability to quickly highlight or filter out data rates for a specific telecomm. Can I do this with DataTables? I am thinking two possible solutions: i) Instead of a Search field to filter, use a drop down list. ii) Buttons with different telecomm. When you click on a button, the telecom selected will highlight data rates (change backgroudn to bright red etc.) corresponding to it. Unfortunately, I am quite newbie at this. So I am not able to use the DataTables live to demonstrate what i like to do :( Thanks! Cliff
- 16th Jul 2014How to use alphanumeric sort in datatable column?I am using datatable where the first column is alphanumeric and is rendered as string. Following is the sample data rendered for the first column when using dataTable jquery plugin: ABC NJ000100 ABC NJ0003001 ABC NJ0005555 ABC NJ000776 ABC NJ0008677 ABC NJ0009001 ABC NJ0009871 ABC NJ000987 However, the expected order is as follows: ABC NJ000100 ABC NJ000776 ABC NJ000987 ABC NJ0003001 ABC NJ0005555 ABC NJ0008677 ABC NJ0009871 ABC NJ0009001 I tried using natural plugin along with dataTable as follows, but that didn't help. $(document).ready(function() { $('#searchResults').dataTable({ "bAutoWidth": false, "aoColumns": [ { "sWidth": "10%" }, { "sWidth": "10%" }, { "sWidth": "20%", "sType": "natural"}, { "sWidth": "20%" }, { "sWidth": "20%" }, { "sWidth": "10%" }, { "sWidth": "10%" } ], "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 4 ] }, { "bSortable": false, "aTargets": [ 6 ] } ] }); });
- 1st Jul 2014Sort a grouped set of Rows?I setup a fiddle here: http://jsfiddle.net/buildakicker/G2vUm/ However, I am wondering if I can somehow have a setup like this: header1 header2 data.... data2.... lots of descriptive stuff.... data.... data2.... lots of descriptive stuff....