Search
3647 results 401-410
Forum
- 20th Feb 2017How do I render a cells value based on a value from the previous rowHello again, I'm trying to render a cell value or even style based on the previous rows value for the same cell. Ive played around with it a bunch and can't seem to get it. Basically if the first columns value is the same as the previous row, I want it to to be blank, otherwise give me the value. Here is what I am getting as a result....followed by what I want AS is EIN / SSNDoctorNPIGroup / Individual 123456SMITH, BOBIndividual 654321Group 654321JONES, MIKEIndividual 654321JACKSON , JOHNIndividual What Im trying to do: EIN / SSNDoctorNPIGroup / Individual 123456SMITH, BOBIndividual 654321Group JONES, MIKEIndividual JACKSON , JOHNIndividual Here is my current code function LoadNpiDataTable(route : string) { $('#NpiTable').DataTable({ "ajax": route, "destroy": true, "columns": [ { "title": "EIN / SSN", data: function (data) { return "<a class='editNpiLink' data-id=" + data.TaxId + " data-docId=" + data.DocId + " >" + data.TaxId + "</a>" } }, { "title": "Doctor", "data": "Name" }, { "title": "NPI", "data": "Npi" }, { "title": "Group / Individual", data: function (data) { if (data.Type == 1) { return "Individual" } else return "Group" } } ] }); } Thanks in advance, any help is greatly appreciated
- 23rd Dec 2016How do I assign a hyperlink on specific cells in my datatable? Please helptable = $('#table').DataTable({ "processing": true, "serverSide": true, "order": [], "ajax": { "url": "", "type": "POST" } }, "columnDefs": [ { "targets": [ -1 ], "orderable": false, }, ], });
- 15th Sep 2016Filtering within CellsIs there a way to use an HTML class or element around text that you don't want to be searchable within a cell? But also leave the rest of the text in that cell searchable?
- 25th Mar 2016Update cell's button when another cell is clickedHow can I click on a button in one cell and update the properties of a button in a different cell in the same row. Specifically I have a row with two buttons (Run, Show/Hide Log). What I would like is for the later to be disabled until the former is clicked on, and for it's text to be altered. Also I'd like the former button to be disabled when it is clicked i.e. it can only be clicked once. Here is a JSFiddle: https://jsfiddle.net/B__D/m8j4s0qe/ Thanks
- 21st Mar 2016i am using ellipses for text overflow for table cells & i wants to show tooltips for txet overflowshow to solve above problems
- 26th Feb 2016Fixed Header - calculating the size of cellsHello, It is not a question but a user back on the use of FixedHeader and a encountered problems. I set up the use of FixedHeader for DataTables in my company's software. However, during integration, there was a huge gap between the size of celulles my new header created by the extension and celulles of the first line of tbody. After that, I looked at the code for calculating these sizes celulles (the focntion: _matchWidths dataTables.fixedHeader the file). FixedHeader uses the width according to the size we return but recovering the size provided by the CSS of the ten elementary using css ( 'width), I have not been offset worries. Because there is a difference between the width calculation function () and css ( 'width): " The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation." Link: http://api.jquery.com/width/ So allow me to point out this difference in interpretation between the two methods to enable a better result as needed cordially Matthieu
- 5th Feb 2016How do I change cells, based on a user editing a different cell?Having a hard time wrapping my brain around how to do this: User changes a 'color' value from 'red' to 'brown'. I want to locate all other rows in the table that have column 'color' == 'red', and change them to 'brown'. I'm using jeditable, and can detect when the user changes the cell.... but then what? How do I loop through all the other rows, detect those that have the same color, change the data, and have the table redrawn to show the udpates. the callback: $( "td.color", oTable.fnGetNodes()).editable( function(value,settings){ return(value); }, { "callback": function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); var currentValue = oTable.fnGetData( this ); if ( aPos ){ if ( currentValue != sValue ){ oTable.fnUpdate( sValue, aPos[0], aPos[2] ); // search out all items in table with the same tag, and update their color too... // ? } } }, "placeholder":' ', } ); Plz send a clue.
- 19th Jan 2016Excel Export - Populate column from data-child-value attribute and preserving markup in cellsI have two questions: 1) I have a data table with expandable rows populated with data from the attribute data-child-value, similar to the code here. I am hoping to export to Excel, but I don't know how to direct the data in the data attribute in each row to a column. Is that possible? 2) Whether or not the first task is possible, I'm also having trouble exporting HTML-like information to Excel. When I export with data similar to what's in the data attribute, it's lost in the resulting Excel spreadsheet. Is there a way to escape the markup that will be presented correctly in the spreadsheet? My attempts to replace the '<' '>' and '/' with entities work, but they remain entities (e.g., <) in the Excel workbook.
- 4th Apr 2015Making rows and cells clickable.I have a scenario whereby I would like to make a row clickable to bring up the full record and have an action button (Delete record) in the last column to call my delete record Ajax. I am using a rowCallback on the row: "rowCallback": function (row, data) { $(row).on('click', function() { location.href="/admin/accounts/"+this.getAttribute('data-id'); }); }, and in my source data, <a href="/admin/accounts/19" alt="Delete Record" data-method="delete" title="" data-toggle="tooltip" data-placement="left" rel="nofollow" data-confirm="Confirm Delete account test" class="btn btn-normal text-red btn-xs btn-link" data-original-title="Delete account test"><i class="fa fa-trash-o"></i></a> However, I seem to have an event binding order issue whereby the Confirm delete dialog box appears, but when you click on OK, the rowCallBack handler is activated and rather than deleting the record, it takes you to my show record screen. Surely someone else has come across a similar problem and resolved it? I have tried to change my rowCallback to recognise the className of the delete object, but have had varying and unpredictable results - sometimes it works and sometimes it doesn't. "rowCallback": function (row, data) { $(row).on('click', function(data) { if (typeof data.target.className != "undefined") { if (data.target.className == "fa fa-trash-o") { return; } } location.href="/admin/accounts/"+this.getAttribute('data-id'); }); Any suggestions or recommendations are greatly appreciated.
- 1st Aug 2014How do you format a number for numeric cells?For datatable 1.10.1, I'm trying to render numbers with 2 d.p. and with the relevant commas. I'm using Ajax to load the data into the table. Thanks, ARK