how to render a column with with options generated via a loop in the data source

how to render a column with with options generated via a loop in the data source

tamadeutamadeu Posts: 1Questions: 1Answers: 0

i have my table's row generated through ajax:
ajax: {
url: 'xxx',
dataSrc: 'products'
},
my columns are set like this:
columns: [
{ data: 'cod' },
{ data: 'name' },
{ data: 'cost' },
{ data: 'weight' },
{
data: null,
defaultContent: '<select><option value="lotes.?.date">lotes.?.date</option></select>',
targets: -2
},
{
data: null,
defaultContent: '<input name="quantidade" class="form-control main-element" type="number" max="${produto.quantidadeTotal}" value="0" id="quantidade_${produtoId}" placeholder="Quantidade" />',
targets: -1
}
]

how could i generate the select tag with the options based on my data source's objects. The quantity of objects may vary from product to product.

Answers

Sign In or Register to comment.