Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
220 views
in Technique[技术] by (71.8m points)

javascript - 如何在jQuery dataTables列中添加一些信息(How to add some information into jQuery dataTables column)

I have this code:(我有以下代码:)

$("table.contentTable").dataTable({ "iDisplayLength": 25, "oLanguage": { "sUrl": "scripts/language/ru_RU.txt" }, "aaSorting": sorting, /* "bJQueryUI": true,*/ "bRetrieve": true, "bProcessing": true, "bServerSide": true, "sPaginationType": "paging_with_jqui_icons", "sAjaxSource": "getAllTripCards", "fnServerData": fnDataTablesPipeline, "aoColumns": [ {"mDataProp": "cardNumber"}, {"mDataProp": "issueDate", "sType": "string-date-euro"}, {"mDataProp": "type"}, {"mDataProp": "position"} ...(...) I need to add a combination of two fields in into a first column.(我需要在第一栏中添加两个字段的组合。) How can I do that?(我怎样才能做到这一点?) I want to make this, but it doesn't work(我想做这个,但是没用) "aoColumns": [ {"mDataProp": "cardNumber" + "issueDate"},   ask by Vytsalo translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use column().header() API to get the column header cell.(使用column().header() API获取列标题单元格。)

You can try this :(您可以尝试以下方法:) $(table.column(1).header()).text('cardNumber/year'); Reference link:(参考链接:) column().header() API(column()。header()API)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...