Search
18367 results 2951-2960
Forum
- 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]
- 31st Dec 2010Off-site JSON AjaxI'm working on a project for a newspaper and, being print media, the ancient CMS is causing problems. I'm trying to get a set of data to appear in a table. The catch is, I don't have access to anything required for server-side processing, and I can only put a txt file of JSON on a file server with a different domain than the sites involved which trips up browser security. My question is, are there any workarounds to get this (http://extras.insidebayarea.com/news/salaries/status/ajaxRequestStatus.html) working in this (http://www.contracostatimes.com/ci_16976082) or am I boned?
- 28th Oct 2010Redraw table after ajax postAwesome plug-in, but I just don't seem to get to redraw my table after I load it up from the server. What I have is a table on which I use datatables [code] $(document).ready(function() { $("#partnerdashboardPlayer table").dataTable({ "aaSorting": [[6, "desc"]], "bProcessing": true, "iDisplayLength": 50, "sPaginationType": "full_numbers", "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] }); }); [/code] When I get data with an ajax-post data from server, I would like to rebind/redraw my table with the new data to be a datatable. How can I rebind my new table as a datatable (table has the same id) [code] // Get partial view (html) $("#franchiseDashboardStatistics").load('/Affiliation/Referrer #ReferrerStatistics', values); // Redraw the table (with the same settings) $("#partnerdashboardPlayer table").dataTable({ "aaSorting": [[6, "desc"]], "bProcessing": true, "iDisplayLength": 50, "sPaginationType": "full_numbers", "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] }); }); [/code] I guess this is not magic, but I just can't seem to get it work...I've tried fnDraw, but still stuck..and puzzled. Regards Jatt
- 2nd Aug 2010Dinamic created tables with ajax, set it to datatablesHi, i have a layout, with 3 zones, on some zones i am adding TABLES throught jQuery .load() method.(not adding it with js, calling to a php who dinamically creates it). On the .load() callback i am calling jQuery('.datatables').dataTable(); but it says that is not possible to re-initialize, because i already called it on the first load so it does not work when adding new tables. What's the way to do it? I was looking for a refresh datatable, etc, but i can't make it work.
- 10th Jun 2010How do i use Database with ASP.NET or AJAXHello All, In my application i am reading some XML file into Dataset from an asp.net page, then trying to bind that to datatable, but not able to do it. Here my code in WebForm4.aspx codebehind [code] protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "text/xml"; FileStream fs = new FileStream(@"C:\Ninad\xmlFeeds\Sample1.xml", FileMode.Open); DataSet ds = new DataSet(); ds.ReadXml(fs); Response.Write(ds.GetXml()); Response.End(); } [/code] Now on WebForm3.aspx i have a datatable which i want to fill with data coming from WebForm4.aspx, heres the code in WebForm3.aspx [code] $(document).ready(function(){ $('#demo').html(''); $('#example').dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "../WebForm4.aspx" }); //End of dataTable }); //End of dataTable </div> </form> [/code] How do i bind the datafrom WebFor4.aspx to the datatable in WebForm3.aspx?