Search
18435 results 2811-2820
Forum
- 1st Aug 2013DataTables AJAX source with sub-arrays and sAjaxDataPropYeah !! Thx Allan. Loïc
- 9th May 2013Event after an Ajax call is completed1 - what is the best way to get the total number of rows? Currently with this plug-in: http://datatables.net/plug-ins/api#fnPagingInfo . v1.10 will have something similar built in. 2 - And how do I customize the number of rows to show in the listbox (it's fixes to 10/25/50/1000) As you say - aLengthMenu :-) Allan
- 27th Feb 2013What's a good way to handle ajax rows with mixed sets of columns?Is there a way I can use the mData property to silently drop null values in when properties aren't defined? Use sDefaultContent and set it to an empty string. Then null or undefined data (as is the case here) will be shown with the default content rather than showing a warning. Allan
- 22nd Feb 2013Custom modal form via server side ajax callThanks for the tips Allan! That was exactly what I was looking for! Below is the code I am using in case anyone else needs something similar. [code] $(document).ready(function() { oTable = $('#example').dataTable(); } ); [/code] add some code for when a row is clicked: [code] $('#example').on('click', 'tr', function (e) { e.preventDefault(); var data = oTable.fnGetData(this); //data for selected record var rowPosition = oTable.fnGetPosition( this ); //position of record in table //alert(data[0]); //id of record in my case //my custom modal code //after submitting form I then just call this to update the row... oTable.fnUpdate( ['id', 'name', 'email', 'phone_styled', 'phone_raw'], rowPosition); // insert new data in row. } ); [/code]
- 4th Feb 2013Styled pagination links not appearing under AJAX loading DatatableOops, sorry I realize I was missing "sPaginationType": "bootstrap",
- 31st Jan 2013Anything to be wary of allowing Edits over a background Ajax table refresh?Thanks Allan, I've used the flag method as suggested and it seems to work just fine. [code] var halt=false; $(document).ready(function() { editor = new $.fn.dataTable.Editor({ ajaxUrl: "./worklog.ajax.php", domTable: "#worklog", events: { onOpen: function(){halt=true; }, onClose: function(){halt=false;} }... [/code] [code] setInterval(function() { if(!halt) { dTable.fnReloadAjax("./worklog.ajax.php"); } }, 120000); [/code]
- 28th Dec 2012Ajax, Few ProblemsYou've enabled server-side processing, but your data source doesn't implement server-side processing. If you want to use server-side processing you need to implement the protocol described here: http://datatables.net/usage/server-side For that few rows though, I'd suggest you don't use server-side processing - there is no need. Allan
- 7th Dec 2012Error dom_sort with ajax sourceProblem solved. I used mRender for input.
- 30th Nov 2012WHERE in AjaxAdd it to the part of the script where the WHERE section is built up. Around line 100. Allan
- 30th Nov 2012Possible Issue in Ajax override example: localstorage.htmlI'm a little confused I'm afraid - I'm not 100% sure exactly what you are asking. I'll try to answer the individual points raised: 1. [quote] TableTools._aInstances[0].s.dt.aoData [NOTE: mostly because of my ignorance, it took me a loooong time of poking around to find the location above [/quote] You really don't want to be accessing those variables directly - they are private (anything starting with an underscore in DataTables land is considered private). Might be useful for debugging, but I'd really recommend you just use the public API to get data and manipulate the table. Certainly manipulating aoData is a great way to break things :-). So, what's the right way to get the JSON data into a hidden form element on submit, for an existing form on the page, so that it shows up in $_POST over in the PHP script? You are trying to get the data form the table, or from the localStorage element? From the table use fnGetData - from localStorage, just read it directly. Editor should keep the localStorage up-to-date when working with it's crud controls. It might not be perfect for your use case - there might be some changes needed (it uses indexing as the row ID for example, which is fairly useless if you have a server-side database somewhere with a unique serial column). It sounds like localStorage and the data are getting out of sync. I'm sure sure why that is - a link would be useful to see what is happening. Allan