Search
18367 results 2931-2940
Forum
- 12th Jul 2013Retaining the DrillDown after ajax callHow can i retain the state if a row is drilled down??
- 11th Jun 2013Single record update with no ajaxI have a asp.net GridView on which I called dataTable() with no params (simpliest scenario). I am updating properties of some record in background. How to update/refresh that record on datatable? I want to persist all paging, sorting and other settings.
- 11th Jun 2013DataTables with MVC3, NHibernate, AJaxI'd like to reload my DataTables with a different set of data using the following: [code] $(test).click(function () { $.getJSON("../GetProjectViaAjax", null, function (data) { [quote]The next 3 lines works, but needs to be replaced with ???[/quote] $.each(data, function (index, car) { alert(car.DrawnBy) }); }); } [/code] The GetProjectViaAjax works properly - it returns a correctly formatted JSON object. I just need a little help getting the DataTable updated from here.
- 18th Apr 2013Using DataTables with UWA Ajax data sourceHi, I've posted a question on StackOverflow which I'm really struggling with. Can anyone help? http://stackoverflow.com/questions/16064828/using-datatables-with-different-ajax-source-i-e-uwa-data-getjson Many thanks, Duncan
- 12th Mar 2013f is undefined for ajax result?I can't for the life of me figure this out, everything I have appears to be correct. Pasting below: My only guess is that perhaps datatables serverside no likie array of objects... The documentation states: array aaData The data in a 2D array. Note that you can change the name of this parameter with sAjaxDataProp. However, in the example at the bottom of the page, the aaData is an array of objects, but the property names seem to reflect an index number? Is that why my code I have below is not working? [code] "aaData": [ { "DT_RowId": "row_7", "DT_RowClass": "gradeA", "0": "Gecko", "1": "Firefox 1.0", "2": "Win 98+ / OSX.2+", "3": "1.7", "4": "A" }, { "DT_RowId": "row_8", "DT_RowClass": "gradeA", "0": "Gecko", "1": "Firefox 1.5", "2": "Win 98+ / OSX.2+", "3": "1.8", "4": "A" } ] [/code] HTML: [code] WO Wo Date Approval Status Type Asset Comp Desc Assign to Work Status Desc [/code] JavaScript: [code] $('#grid').dataTable({ 'sAjaxSource': '/X3Plus/Entities/Starred/WORK/', 'sServerMethod': 'POST', "aoColumns": [ { "mData": "wo" }, { "mData": "date_wo" }, { "mData": "aprv_stat" }, { "mData": "wo_type" }, { "mData": "compid" }, { "mData": "comp_desc" }, { "mData": "assignto" }, { "mData": "workstatus" }, { "mData": "brief_desc" } ] }); [/code] JSON Result: [code] "{"sEcho":1,"pageCount":13,"currentPage":1,"iTotalRecords":134,"iTotalDisplayRecords":0,"aaData":[{"wo":2,"date_wo":"05/21/2004","aprv_stat":"","wo_type":"MMETER","compid":"023-23-20-096-01","comp_desc":"BODYMAKER/WELDER","assignto":"","workstatus":"H","brief_desc":""},{"wo":3,"date_wo":"05/21/2004","aprv_stat":"","wo_type":"MMETER","compid":"023-23-24-096-01","comp_desc":"BODYMAKER/WELDER","assignto":"","workstatus":"H","brief_desc":""},{"wo":4,"date_wo":"05/25/2004","aprv_stat":"","wo_type":"MWEEKLY","compid":"023-23-20-096-01","comp_desc":"BODYMAKER/WELDER","assignto":"","workstatus":"H","brief_desc":""},{"wo":5,"date_wo":"05/25/2004","aprv_stat":"","wo_type":"MWEEKLY","compid":"023-23-20-104-01","comp_desc":"BOTTOM DOUBLE SEAMER","assignto":"","workstatus":"H","brief_desc":""},{"wo":6,"date_wo":"05/26/2004","aprv_stat":"","wo_type":"MMETER","compid":"023-23-26-096-01","comp_desc":"BODYMAKER/WELDER","assignto":"","workstatus":"H","brief_desc":""},{"wo":7,"date_wo":"06/18/2004","aprv_stat":"","wo_type":"","compid":"023-21-L2-PRESS- DO N","comp_desc":"LITHO PRESS","assignto":"","workstatus":"H","brief_desc":""},{"wo":15,"date_wo":"03/02/2000","aprv_stat":"","wo_type":"MWEEKLY","compid":"023-23-109-01","comp_desc":"BANDER/STRAPER","assignto":"","workstatus":"H","brief_desc":""},{"wo":22,"date_wo":"10/01/2004","aprv_stat":"","wo_type":"MWEEKLY","compid":"UNKNOWN","comp_desc":"","assignto":"","workstatus":"H","brief_desc":""},{"wo":2000,"date_wo":"03/31/2009","aprv_stat":"","wo_type":"PM","compid":"023-20-01-020-02","comp_desc":"","assignto":"eMaint Test (Sylvain Bujold)","workstatus":"O","brief_desc":"Workflow Fired"},{"wo":2938,"date_wo":"03/20/2012","aprv_stat":"","wo_type":"PREVENTATIVE","compid":"42-022-98-PMP-05","comp_desc":"","assignto":"CC\u0026S (Brian Grassler)","workstatus":"O","brief_desc":"B30 Compound pumping Station - Perform on Tuesday night."}]}" [/code]
- 17th Dec 2012Without clearing the entire records on Ajax callI'm using server-side processing code to retrieve all data. So far it's working fine. Now, I am checking the database every minute whether new record is been inserted or not. I am calling dataTables function if new record is been inserted in database. At the time its clearing entire records and displaying the records with newly inserted records. Can we do without clearing the existing data? or can we append the newly inserted record into existing record without clearing the record?
- 26th Nov 2012Server side ajax table with fix heightI am having a problem trying to set the height of my table. Here is the code: var oTable = $('#example').dataTable({ "sScrollY": "700px", "sAjaxSource": "../AjaxHandlerRules", "bServerSide": true, "sDom": "frtiS", "bInfo": false, "iDisplayLength": 100, ..... I want the table to display with 700px height with scrollY. The AjaxHandlerRules returns me a Json object. Thanks in advance, Matias
- 14th Oct 2012C# Simple Ajax Example Gets JSON Formatting ErrorThis is the most basic example that I can think of. I'm manually creating the JSON in a string to pass back to data tables call. The JSON returned certainly looks to be well formed, but DataTables is throwing the error: 'DatatTables warning (table id='table_id'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.' The JSON returned in the response, captured in Firefox/Firebug is as follows: {"sEcho": 1,"iTotalRecords": "2","iTotalDisplayRecords": "2","aaData":[["Vendor1","10","20","30","50"],["Vendor1","10","20","30","50"]]} This seems to be a valid JSON string as per the DataTables documentation. Can anyone tell me what is going wrong here? The HTML Page: <style type="text/css" title="currentStyle"> @import"/Styles/demo_table.css"; @import"/Sytels/demo_page.css"; </style> <script type="text/javascript"> var oTable; $(document).ready ( function () { $("#table_id").dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "WebForm1.aspx" }); }); Vendor Past 7 Days Past 24 Hours Past Hour Rejects Outstanding > The ASPX Code Behind: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; using System.Web; using System.Web.UI; using System.Data; using System.Data.SqlClient; using System.IO; namespace DataTablesInWebApplication { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, System.EventArgs e) { string dtJSONString; dtJSONString = @"{"; dtJSONString = dtJSONString + @"""sEcho"": " + Request["sEcho"] + ","; dtJSONString = dtJSONString + @"""iTotalRecords"": ""2" + @""","; dtJSONString = dtJSONString + @"""iTotalDisplayRecords"": ""2" + @""","; dtJSONString = dtJSONString + @"""aaData"":["; dtJSONString = dtJSONString + "[" + @"""Vendor1""," + @"""10""," + @"""20""," + @"""30""," + @"""50""],"; dtJSONString = dtJSONString + "[" + @"""Vendor1""," + @"""10""," + @"""20""," + @"""30""," + @"""50""]"; dtJSONString = dtJSONString + "]}"; HttpContext.Current.Response.Write(dtJSONString); }
- 4th Oct 2012DataTables Not Reloading with Ajax callI have a situation where on selection of value from a drop down the content table to be fetched. For first selection its loads the data properly but after that if i select another element then the function is being called and alert is also coming but datatable is not fetching the data again. function selectCountry(Country) { ctry = Country.value; window.alert(Country.value); $("#SellOut").dataTable({ "sPaginationType": "full_numbers", "sAjaxSource" : 'dataentryconfig/FetchConfigTable.html?Country='+Country.value, "bJQueryUI": true, "sAjaxDataProp" : 'sellout', "aoColumns" : [ { mDataProp : 'fieldId' , "fnRender": function ( oObj ) { if(oObj.aData["fieldId"]!=null){ return '<input type="text" value="'+oObj.aData["fieldId"]+'" readonly="readonly">'; } } },{ mDataProp : 'displayTitle' , "fnRender": function ( oObj ) { if(oObj.aData["displayTitle"]!=null){ return '<input type="text" value="'+oObj.aData["displayTitle"]+'" readonly="readonly">'; } } }, { mDataProp : 'mandatory' , "fnRender": function ( oObj ) { if(oObj.aData["mandatory"]=='Y'){ return '<input type="checkbox" disabled="disabled" checked="true"> '; } else { return '<input type="checkbox" disabled="disabled" > '; } } } ,{ mDataProp : 'configId' , "fnRender": function ( oObj ) { if(oObj.aData["configId"]!=null){ return '<input type="text" value="'+oObj.aData["configId"]+'" readonly="readonly">'; } else { return '<input type="text" value=" " readonly="readonly"> '; } } }, { mDataProp : 'inputMandatory', "fnRender": function ( oObj ) { if(oObj.aData["inputMandatory"]=='Y'){ return '<input type="checkbox" checked="true" > '; } else { return '<input type="checkbox" value=" " > '; } } } , { mDataProp : 'visible' , "fnRender": function ( oObj ) { if(oObj.aData["visible"]=='Y'){ return '<input type="checkbox" checked="true"> '; } else{ return '<input type="checkbox" value=" " > '; } } } ,{ mDataProp : 'defaultValue', "fnRender": function ( oObj ) { if(oObj.aData["defaultValue"]!=null){ return '<input type="text" value='+oObj.aData["defaultValue"]+'> '; } else { return '<input type="text" value=" "> '; } } } , { mDataProp : 'ctryTitle' ,"fnRender": function ( oObj ) { if(oObj.aData["ctryTitle"]!=null){ return '<input type="text" value='+oObj.aData["ctryTitle"]+'> '; } else { return '<input type="text" value=" "> '; } } } ], "bRetrieve" : true, "bDestroy" : true }); Please help
- 1st Oct 2012Not able to display JSON data sent from serverside to Datatable with ajax callPlease help, i have tried everything. JS Bin link - http://live.datatables.net/iqisuz/2/edit#javascript,html Debugger character reference - acuyoq