Search
43567 results 7281-7290
Forum
- 27th May 2013Saving a table setupI am considering using DataTables as a reporting tool and would like to allow users to create custom reports from the tables, save the setup for the report and then reload the report at a later time. Other that the state save functionality, is there something within DataTables, an extra or a plug-in that would allow me to do that? I'm thinking essentially it would require saving the DataTables objectand settings, plus any filters and/or column rearrangements that have been applied. Thanks for a great library!
- 14th May 2013Adding edit/remove/create row function into table which contains array of objectsI have a problem with including functions that editing , removig and creating rows. The code stops working when I declarate an 'editor' as an dynamic array.. ;/ Here's the code. Maybe someone will help :) [code] var editor; /* Data set - can contain whatever information you want */ var aDataSet = [ ['Trident','Internet Explorer 4.0','Win 95+',Math.floor((Math.random()*10)+1),'X'], ['Trident','Internet Explorer 5.0','Win 95+',Math.floor((Math.random()*10)+1),'C'], ['Trident','Internet Explorer 5.5','Win 95+','5.5','A'], ['Trident','Internet Explorer 6','Win 98+','6','A'], ['Trident','Internet Explorer 7','Win XP SP2+','7','A'], ['Trident','AOL browser (AOL desktop)','Win XP','6','A'], ['Gecko','Firefox 1.0','Win 98+ / OSX.2+','1.7','A'], ['Gecko','Firefox 1.5','Win 98+ / OSX.2+','1.8','A'], ['Gecko','Firefox 2.0','Win 98+ / OSX.2+','1.8','A'], ['Gecko','Firefox 3.0','Win 2k+ / OSX.3+','1.9','A'], ['Gecko','Camino 1.0','OSX.2+','1.8','A'], ['Gecko','Camino 1.5','OSX.3+','1.8','A'], ['Gecko','Netscape 7.2','Win 95+ / Mac OS 8.6-9.2','1.7','A'], ['Gecko','Netscape Browser 8','Win 98SE+','1.7','A'], ['Gecko','Netscape Navigator 9','Win 98+ / OSX.2+','1.8','A'], ['Gecko','Mozilla 1.0','Win 95+ / OSX.1+',1,'A'], ['Gecko','Mozilla 1.1','Win 95+ / OSX.1+',1.1,'A'], ['Gecko','Mozilla 1.2','Win 95+ / OSX.1+',1.2,'A'], ['Gecko','Mozilla 1.3','Win 95+ / OSX.1+',1.3,'A'], ['Gecko','Mozilla 1.4','Win 95+ / OSX.1+',1.4,'A'], ['Gecko','Mozilla 1.5','Win 95+ / OSX.1+',1.5,'A'], ['Gecko','Mozilla 1.6','Win 95+ / OSX.1+',1.6,'A'], ['Gecko','Mozilla 1.7','Win 98+ / OSX.1+',1.7,'A'], ['Gecko','Mozilla 1.8','Win 98+ / OSX.1+',1.8,'A'], ['Gecko','Seamonkey 1.1','Win 98+ / OSX.2+','1.8','A'], ['Gecko','Epiphany 2.20','Gnome','1.8','A'], ['Webkit','Safari 1.2','OSX.3','125.5','A'], ['Webkit','Safari 1.3','OSX.3','312.8','A'], ]; $(document).ready(function() { editor = new $.fn.dataTable.Editor( { "fields": [ { "label": "Nazwa (PL)", }, { "label": "Nazwa (ENG)", }, { "label": "Ilość osób", }, { "label": "Ilość osób", }, { "label": "", } ] } ); // New record $('a.editor_create').on('click', function (e) { e.preventDefault(); editor.create( 'Create new record', { "label": "Add", "fn": function () { editor.submit() } } ); } ); // Edit record $('#example').on('click', 'a.editor_edit', function (e) { e.preventDefault(); editor.edit( $(this).parents('tr')[0], 'Edit record', { "label": "Update", "fn": function () { editor.submit() } } ); } ); // Delete a record (without asking a user for confirmation) $('#example').on('click', 'a.editor_remove', function (e) { e.preventDefault(); editor.remove( $(this).parents('tr')[0], '123', false, false ); editor.submit(); } ); $('#dynamic').html( '' ); $('#example').dataTable( { "aaData": aDataSet, "aoColumns": [ { "sTitle": "Nazwa (PL)" }, { "sTitle": "Nazwa (ENG)" }, { "sTitle": "Ilość osób" }, { "sTitle": "Ilość osób", "sClass": "center" }, { "sTitle": "", "sClass": "center" }, { "sClass": "center", "sDefaultContent": 'Edit / Delete' } ] } ); } ); [/code]
- 14th May 2013Display only when table header is not visible ( top header )With FixedHeaders i wanted to have the cloned header only to show when the original header was not visible. My config is top headers only I just updated the function in the plugin : _fnScrollFixedHeader ( around line 588 ) [code] // Lines where this._fnUpdateCache( oCache, 'sPosition', "absolute", 'position', nTable.style ); is fired this._fnUpdateCache( oCache, 'sDisplay', "none", 'display', nTable.style ); // Lines where this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style ); is fired this._fnUpdateCache( oCache, 'sDisplay', "block", 'display', nTable.style ); [/code] Thought i should share if someone is searching something similar Stefan :)
- 13th May 2013Defining a max-height and max-width to all cells in table.Hi All, I want to define the maximum width and height for all cells. At present, I'm using with ColReorderWithResize in the Datatable. The problem comes when a larger string comes in one of the column, Datatable expands the cell height or width automatically and that changes the layout. I want that string to use the ' overflow : hidden ' like property in order to make the string display go behind the next column OR achieve something like http://jsfiddle.net/gtRnn/ .. Whenever the column is resized then the data in the cell should show up OR wrapped up with trailing '..'. How can I do this with ColReorderWithResize? Any help is appreciated ! Regards
- 6th May 2013Can't get dynamic table loaded with JSON to work to save my life.I've tried a million combinations. I initialize the datatable on document ready; $('#occTableData').dataTable({"sPaginationType": "bootstrap"} ); Here's the HTML: ID Title Description Status Company Account Amount Assigned To Here's the javascript function. You can see the commented out section. I've tried that also.; function populateData() { // Populate Row Data $.ajax( { type: "GET", url: 'api/occ/occStage.htm', data: 'userId='+userId, contentType: 'application/json; charset=utf-8', dataType: "json", success: function(adata) { // $("#occTableData").empty(); /// $("#occTableData").append('IDTitleDescriptionStatusCompanyAccountAmountAssigned To'); occData = adata; /* $.each(adata, function(index,item) { alert(item.title); $("#occTableData").append(''+ ''+item.occStageId+''+ ''+item.title+''+ ''+item.description+''+ ''+item.statusCd+''+ ''+item.companyCd+''+ ''+item.accountId+''+ ''+item.amount+''); $("#occTableData").datatable().fnAddData([item.occStageId,item.title,item,description,item.statusCd,item.companyCd,item.accountID,item.amount,item.assignedToUserid]); }); */ $('#occTableData').dataTable( { "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>", "sPaginationType": "bootstrap", "oLanguage": { "sLengthMenu": "_MENU_ records per page" }, "aoColumns": [ { "mDataProp": "occStageId" }, { "mDataProp": "title" }, { "mDataProp": "description" }, { "mDataProp": "statusCd" }, { "mDataProp": "companyCd" }, { "mDataProp": "accountId" }, { "mDataProp": "amount" }, { "mDataProp": "assignedToUserid" } ] }); // $('#occTableData').dataTable().fnAddData([adata]); } // end success }); // end populate OCC data } Here's the JSON data; [{"occStageId":"628","parentOccStageId":"628","instanceOrder":null,"accountId":"100050","companyCd":"RSS","createdDtTm":"2013-05-02","postByDt":"2013-05-02","createdByUserid":"c0123456","createdByName":"sudha Kukkala","billCycleCd":"R16","statusCd":"WORKING","amount":"-200.00","creditOrDebit":"C","chargeCd":"ADJPYMT","title":"occ new","assignedDtTm":"2013-05-02","assignedToUserid":"c0123456","assignedToName":"sudha Kukkala","billPeriodDt":null,"invoiceNo":null,"svcPlanCds":null,"description":"occ new","groupCd":"QAWH","fullName":null,"custAcct":null,"carrierId":null,"opcAccountId":null,"opcChargeCd":null},
- 2nd May 2013how to Show only search box on table load (hide the all row) after the search particular row displayplease help .... how to do this.. via datatables jquery
- 1st May 2013how to retrieve data table rows according to drop down selected options ?am having dynamic drop downs on one column. if i type those text from drop down on search filed, is it possible to retrieve all rows that which dropdown has that text as selected. Tell me a way to do this.
- 25th Apr 2013how to retrieve a table in a string (could be JSON) ?Hello, I've a web site, that display some data with dataTables. The user can filter those data to do a subset selection. My problem is, by clicking on a button (for example), to extract the filtered data (in fact the first column) to do a php treatment. If I can obtain those data, I can then use an Ajax script, it's not a problem. My problem, is how do the extraction ? For example, simply, clicking on a button, how can I have an alert box with those data ? Any tutorial is welcome ! Thank a lot, Sohnic
- 31st Mar 2013each all the records in the tableHello Friends! through each record I get the entire column, but I get just those on page 1 as possible to obtain all records of a column of all pages? greetings and thank you very much
- 21st Mar 2013Filter a table by another meansok, i have a databable being populated, which contains a reference field. I also have ASP.NET repeater, which displays subset of the items being displayed in the datatable, which also happens to have the reference field. I've marked the repeater reference as a hyperlink, and want ot know if it is possible, to filter the datatable based upon the value of the item being selected in the repeater?