Search
4182 results 121-130
Forum
- 30th Mar 2020DataTable ColumnDefs target is invoking for PDF/Excel creation..
- 27th Jun 2019empty fields trigger bug in columnDefs?Hi @takaest , We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here. Cheers, Colin
- 19th Jan 2019how render other column data in datatable columndefs...I guess you are asking about date1 and date2 in this line: data = '<a href="User.jsp?date1=' + date1 + '&&date2='+ date2 +'&&status='+ 'Open' +'&&sa_id='+ ..... +'">' + data + '</a>' date1 and date2 need to be variables available within the scope of where you initialized Datatables. If this doesn't help then please provide a description of the problem you are having. Kevin
- 2nd Jan 2019NaN columnDefsWell I have solved this problem, but it still remains a bit of a mystery. All I did was change the class name of the column from exrate to ex_rate which then produced the expected result. Completely baffling! //Each Cost Price { targets: "each_cost_price", render: function(data, type, row, meta) { if (row["cost"] && row["ex_rate"] && row["unit"] !== null) { return "£" + (row["cost"] / row["unit"] / row["ex_rate"]).toFixed(2); } if (data == null) { return ""; } else { return "£" + data; } } } The above code now works.
- 19th Jun 2018How to render the columns or columnDefs for a dynamic data source?Final result <script> var dataSet = <%= JsonConfigData %> var dataColumns = <%= JsonDataColumns %> $('#table_id').DataTable({ "scrollY": 450, "scrollX": true, "paging": false, data: dataSet, columns: dataColumns }); </script>
- 15th Jan 2018columnDefs render function text input value when filteredIf you are using columns.render to calculate a value, you need to use cells().render() to get the rendered value, as rows().data() will give the original data (which in this case would be the uncalculated value(s)). Allan
- 26th Aug 2016columnDefs and multiple classNamesAh, yes I see. Backwards compatibility is most definitely important! With that in mind for the className option, another possibility could be a directive within that option called "appendClass" that defaults to FALSE, as well as an option called "allowOverwrite" that defaults to TRUE. That way backwards compatibility could be achieved along with controlling individual class attributes and giving/taking certain priority independent of the order. Just another idea. No idea how much work would be involved with that though ... We are putting together a DataTables+Shiny app, and our goal is to utilize the data's column names to assign classes, currency/percent, and other useful things. Anyhow, thank you again Allan, your work is great. :smile:
- 18th May 2016ColumnDefs not working with responsiveYep, just added width="100%" to the table element and it worked fine. Thanks for your help Allan, much appreciated
- 24th Feb 2016which callback should i use to change columnDefs target on demand?Currently no. That is a feature I hope to add in a future version of Editor. Allan
- 15th Feb 2017columnDefs "name" not changing header textHi, I'm trying to change some column's names according to the reference, but obviously I'm missing something, because it's not working: jsfiddle example Thanks for any help. Edit: Obviously I'm an idiot. I thought that option changes column header text (use keyword "title"!!), but it's just for further api reference. Sorry. You can delete this.