How to load a combobox in a particular column with different values for different rows

How to load a combobox in a particular column with different values for different rows

psathiya1987psathiya1987 Posts: 2Questions: 0Answers: 0
edited September 2012 in General
Hi, Below I have provided the table data that I want to render using datatables.

[code]
var location2=[
[ "Trident", "Internet Explorer 4.0", [45,67,76], 4, "X" ],
[ "Trident", "Internet Explorer 5.0", [57,89,90], 5, "C" ],
[ "Webkit", "Safari 3.0", [10,20,30], 522.1, "A" ]
];
[/code]

I have rendered the table as below
[code]
$('#example').dataTable( {
"aaData": location2,
"aoColumns":[
{ "sTitle": "Engine" },
{ "sTitle": "Browser" },
{
"sTitle": "Platform",
"sClass": "center",
"fnRender": function(obj) {
return '' + '2010' + '2011' + '2012' + ' ';
}
},
{ "sTitle": "Version", "sClass": "center" },
{ "sTitle": "Grade" }

]
}
);
[/code]

I want to add a combo box in the 3rd column "Platform" for all rows with the value for the combobox in each row to be dependent on the input. like [45,67,76] should be available in the combobox in row1 and [57,89,90] should be available in the combobox in row2 and so on.

Hope I have explained myself clearly my problem.

Please advice

Replies

  • psathiya1987psathiya1987 Posts: 2Questions: 0Answers: 0
    Hi, Can someone help me here. I am stuck as to how implement this.
  • MitchCapperMitchCapper Posts: 3Questions: 0Answers: 0
    well fnRender (now mRender) is past the data for the cell so you could build off that, you could also use fnCreatedCell to create the html for it and again it gets the data to work with.
This discussion has been closed.