问题描述:

i am tying to implement the django multi select widget in my app.

It works fine. But i need some help to auto-fill the "to" select field with values from the database.

Actually i have build a jquery json object of the required data.

 $.each(sport_intrested_obj, function (sport_name, obj) {

console.log(sport_name) //works fine

console.log(obj['id']) // works fine

$('#id_s_sports_assigned_to').append(

$("<option></option>")

.attr("value",obj['id'])

.text(sport_name));

});

"id_s_sports_assigned_to" is the dropdown where i want to auto populate the details

相关阅读:
Top