Following from this article, I'm trying to use a dropdownlist when I'm editing one of the columns in the DataTable to which I have applied the jquery datatable and jEditable plugin.
In the initialization of jEditable:
$('#myDataTable').dataTable().makeEditable({
"aoColumns": [
{
//Empty object is used for the default editable settings
},
null,//null for read-only columns
{
indicator: 'Saving...',
tooltip: 'Click to select town',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
loadurl : 'GetSelectList',
loadtype : 'GET'
}
]
});
It calls the GetSelectList action in the server, but I don't know what type of data I should return to the client. I have a Category model which has id and name. I can get them by GetCategories function. I need the final selectlist to be something like:
<select name="category" id="country" rel="6">
<option value="1">cate1</option>
<option value="2">cate2</option>
<option value="3">cate3</option>
</select>
I searched the net, and the only thing that I have found was an article in php, which is Greek to me.