Populate a list within a cell

Populate a list within a cell

toriachttoriacht Posts: 20Questions: 5Answers: 1
edited March 2013 in DataTables 1.9
Hi,

I'm trying to populate a datatable cell with an icon and a drop down list. I'm almost there! However when the list pops up it does not appear over whichever cell i clicked on , it always appears over the same cell at all times.

I populate the table as below:

Thanks,
T

[code]
$(document).ready(function(){

var oTable = $('.data-table').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fpr>',
"bProcessing": true,
"sAjaxSource": "./data-subset.json",
"aoColumns": [
{"mDataProp": "date"},
{"mDataProp": "upload"},
{"mDataProp": "download"},
{
"mDataProp": "status",
"fnRender": function(oObj) {
var labelClass;
if(oObj.aData["status"] == 'Success') {
labelClass = 'success';
}
if(oObj.aData["status"] == 'In Progress') {
labelClass = 'warning';
}
if(oObj.aData["status"] == 'Fail') {
labelClass = 'important';
}
return ''+oObj.aData["status"]+'';
}
},
{
"bSearchable": false,
"bSortable": false,
"mDataProp": null,
"fnRender": function(oObj) {

return '' +
'' +
' <' +
'/a>' +
' Download';
}
}
]
});
[/code]

Replies

  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    edited March 2013
    Suggestion: Use mRender instead of fnRender (will be deprecated from 1.10 version).
    use aoColumnDefs and target the column in which you need the list to be shown

    Ref: http://datatables.net/ref#mRender
This discussion has been closed.