Search
18504 results 2961-2970
Forum
- 26th Mar 2012Sort Desc AJAXHi There. I am having an issue with this sorting the following. It loads everything fine and sorts by the correct column, however, it's ascending. I would like to have it sort on load descending but am not sure how to do so. Any advice would be greatly appreciated. Thanks Derrick $('#myTable').dataTable({ "bProcessing": true, "bAutoWidth": false, "bJQueryUI": true, "sAjaxSource": "/path/to/service/", "aoColumns": [ { "mDataProp": "LabNumber", "sType": "string"}, { "mDataProp": "DateClosed" }, { "mDataProp": "ConsumerName" }, { "mDataProp": "Status" }, ] });
- 18th Feb 2012Details of a row with extra (ajax) callHi, I'm wondering if it is possible to use a separate call when the user clicks on the detailed information icon of a row. I'd like to present details for that selected row which are not in any hidden columns but can be generated a server-side script. I just need help to set up the client side function which will call the server side php. Thanks, Peter
- 28th Nov 2011Duplicate Rows On Ajax RequestI'm using following code in ASP.NET MVC Application. If first time five records render then on every next request records five duplicate records will add. How can I solve this problem? $('#tableStandardResults').dataTable({ "sPaginationType": "full_numbers", "bFilter": false, "bDestroy": false });
- 25th Nov 2011Fixed column width and Ajax datasourceHello! I have an issue with the columns width. I need several columns with the fixed width, so I use following config: [code] $('#table-users').dataTable({ "bProcessing": true, "sDom": 'T<"clear">"<"top"lf<"clear">>rt<"block-actions"ip>"', "sAjaxSource": '/admin/get_users_list', "bAutoWidth": false, "sScrollX": "100%", "oTableTools": { ........ }, "aaSorting": [], "aoColumnDefs": [ { "sWidth" : "200px", "aTargets": [ 17 ] } ] }); [/code] When the page is loaded the width of the 17th column is equal to "200px", but when data is loaded, width recalculation occurs and the 17th column becomes shorter. Could anyone help with this issue ? Best regards, Andrey
- 1st Nov 2011Problem running ajax methodHello Allan and all, I have seen this problem in the forums but didn't see an answer. When I run my PhP script under firebug, I get the following error: [quote] oColumn.asSorting is undefined oSettings.aaSorting[i][1] = oColumn.asSorting[0]; [/quote] my table initialization is as follows: [code] $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "bServerSide": false, "sAjaxSource": "get_table_info.php", "fnServerParams": function ( aoData ) { aoData.push( { "name": "more_data", "value": "my_value" } ); } } ); } ); [/code] I am trying to dynamically create a table by passing its name from a select (drop-down) box and I see that the script is properly getting the table name. Is this possible using datatables? I populate the select box using mysql (show tables) and build the column list using mysql (describe table) on the selected table name. All suggestions will be greatly appreciated!
- 31st Aug 2011load scroll_y.html with ajaxHi I recently started trying out with this jquery. I am trying to do a basic example. I have a page with input button and a a division "main_div". when I click the button I need to load the scroll_y html (the given example) into the main_div division. the data is loaded but the scroll bar and sorting facilities are disabled. The only difference I did to the scroll_y html is i changed the initialization code to [code] $(document).ready(function() { alert("sdfdfsf") $('#example').dataTable( { "bProcessing": true, "sAjaxSource": '../ajax/sources/arrays.txt' } ); } ); [/code] I request the page through, [code] function fetchtable(){ var url = "scroll_y.html" alert(url) var ThisHTTPRequest = getobject(); ThisHTTPRequest.onreadystatechange = function() { if (ThisHTTPRequest.readyState == 4) { var res = ThisHTTPRequest.responseText document.getElementById('main_div').innerHTML =res } } ThisHTTPRequest.open("GET",url,true); ThisHTTPRequest.send(null); } [/code] I really appreciate some help in this. Regards, Shamali
- 11th Jun 2011Getting Started - Populating the table via AJAXHere's another mini-article showing how to populate and repopulate the table. It also discusses the difference in Content-type between text/plain and application/json. http://www.britseyeview.com/software/dtgs/poptable.html
- 21st Mar 2011datatable with ajax source errorI'm getting the error: The page at http://localhost says:DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. My JSON data looks like: {"aaData":[["87","KINGSTON","Smith","John","2011-03-19","2011-03-26","25"],["86","KINGSTON","Smith","John","2011-03-19","2011-03-26","25"]]} I'm initializing my table like so: [code] if (typeof oTable == 'undefined') { oTable = jQuery('#schedule').dataTable({ "sAjaxSource": jQuery("#fetch_schedule_url").html().toString() }); } [/code] And my html is: [code] idLocationLast NameFirst Name Start DateEnd Date% Time [/code] Any help would be appreciated.
- 10th Mar 2011Checkbox change causes ajax call to server side script - how?simple datatable, 3 columns - a checkbox with an id having an embedded user_id (ie box_1 where 1 is the user id for the user displayed on this row), a role descriptor, and the users name when the checkbox state in the data table is changed (unchecked to checked, or checked to unchecked) I want to have a server side script called that is passed the values from the datatable row in question so that I can dynamically update the data without having to submit the form. I looked though the examples, the api, and the custom plugins list and searched the forum without finding any reference on how to do this - can someone provide a quick pointer on a direction to make this happen?
- 25th Feb 2011Setting iDisplayStart when using ajax data only - version 1.7.5I have seen this issue pop up a couple times around the forum but not found that any of them seemed to fix the issue i was having. I found that when setting iDisplayStart and using sAjaxSource/bProcessing data method, it would not set and kept resetting to zero. All other display configs, such as the iDisplayLength and oSearch worked fine. To note as well here, I'm using datatables with a custom save(via aoDrawCallback) and load handle bypassing the native cookie handle built into datatables. This change might not be the best solution but it was the pin point to where it was going wrong for my use. I have not tested the effects of this change when using cookies but hope it might be useful for other people. This is the snippet of code i used to initialize datatables. [code] var oTable; args = { "sPaginationType": "full_numbers", "bProcessing":true, "sAjaxSource":"/ajax_datatable", "iDisplayStart":50, "iDisplayLength":25 }; oTable = $('#tableid').dataTable(args); [/code] Note: I can not give a live example of this as I'm working on an in-house offline application. After some trawling through the code i came across this function "_fnInitalise": [code] /* Reset the init display for cookie saving. We've already done a filter, and * therefore cleared it before. So we need to make it appear 'fresh' */ oSettings.iInitDisplayStart = oSettings._iDisplayStart; [/code] This was resetting display start to zero in every case i attempted so i changed it to this to grab the value i was setting. [code] oSettings.iInitDisplayStart = oInit.iDisplayStart; [/code]