Search
18504 results 2941-2950
Forum
- 19th Dec 2013Ajax content and row color not working with paginationHello world. Issue is I dynamically add content to a table and force the color using: $("#main_dash tbody tr:nth-child(" + index + ")").css("background-color", item['color']); This works great on the first page but is lost on any other pages. Please let me know what I can do. Code below: HTML: [code] Employee: <br/> Date Type Regarding Submitted By Review Assign [/code] JS: [code] var mainTable = $("#main_dash").dataTable({ "oLanguage": { "sEmptyTable": "There are currently no groom logs to be assigned.", }, "sPaginationType": "full_numbers", "iDisplayLength": 10, "aaSorting": [ [1, "asc"] ], }); $("#dash_view").autocomplete({ source: '/process/get_users.php', minLength: 2, select: function (event, ui) { var name = ui.item.value; var uid = ui.item.id; var query = "func=dash_view&uid=" + uid; ajaxRequest(query, function (data) { $("h3").text(name + "'s Dashboard"); mainTable.fnClearTable(0); mainTable.fnDraw(); data = $.parseJSON(data); $.each(data, function (i, item) { var index = mainTable.fnAddData([ item['flagged'], item['date'], item['type'], item['regarding'], item['submitted'], "<button class='button button-blue review_item'>Review</button>", '<span class="groom_id hidden">' + item['groom_id'] + '</span><input type="text" class="user_list"/>', ]); ++index; $("#main_dash tbody tr:nth-child(" + index + ")").css("background-color", item['color']); }); $("#dashboard_viewer").show("slide", { direction: "up" }, 1000); $(".user_list").autocomplete({ source: '/process/get_users_access.php', minLength: 2, select: function (event, ui) { var row = $(this).closest('tr')[0]; var groom = $(this).parent().children("span:first").text(); var name = ui.item.value; var aid = $("#aid").text(); mainTable.fnDeleteRow(row); var query = "func=assign_groom&groom_id=" + groom + "&name=" + name + "&aid=" + aid; ajaxRequest(query, function (data) { successMsg('Assigned groom ' + groom + ' to ' + name); }); } }); }); }, }); [/code]
- 5th Dec 2013Jquery Ajax submit - Datatable is not sent to the submission[code]$.ajax({ type:'POST', data:$('#form-create').serialize(), [/code] [code] oTable = $('#datatables').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); [/code] This is sending only the other form data which are not datatables. I want to send the form data and datatables together for the submission. What is the best way to achieve this?
- 19th Nov 2013Chrome and ajaxHi. Today open my table on Chrome and see... http://radikal.ru/fp/30ec12745af84126898b3a2a9009d878 that width TH not equal width TD Opera, mozzila, IE: all nice!! Chrome: bag...
- 27th Oct 2013make fixed Width jquery data table with ajax Data source conditional when no records are thereI am using jquery data table Fixed width pluggin with jax data source.First 4 columns are fixed.My requirement is that if there is no records in the DB,I wont show fixed width grid.It should be normal grid. I am assigning the total records in hidden field. But unfortunately it is not working when FixedColumns is called.plz help! "fnServerData": function (sSource, aoData, fnCallback) { aoData.push({ "name": "CompanyID", "value": MasterRecordID }); $.getJSON(sSource, aoData, function (json) { fnCallback(json) if (json != null) { document.getElementById("hdTot").value = json.iTotalDisplayRecords; if (json.iTotalDisplayRecords == 0) { alert('No Record Found'); } else { //$("#spGetAll").css('display', 'block') } } else { alert('Som problem occured'); } } ); } "fnInitComplete": function () { if (document.getElementById("hdTot").value == "0") { return; } else { new FixedColumns(oTable, { "iLeftColumns": 3, "iLeftWidth": 350 }); }
- 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?