Create Jquery dropdown dynamically inside bootstrap table

278
September 14, 2017, at 7:32 PM

I want to create a dropdown for each entry in the bootstrap table. These entries are received from the service methods. Here is how I am trying to create the dropdown,

 var combo = $("<select></select>").attr("class", "drop col-sm-6");
  if(obj.interest=="Not Interested")
  {
     //alert("Inside not interested");
combo.append("<option>" + obj.interest + "</option>");
combo.append("<option>Interested</option>");
combo.append("<option>Call on Later</option>");
  }
   if(obj.interest=="Interested")
  {
      //alert("Inside Interested");
combo.append("<option>" + obj.interest + "</option>");
combo.append("<option>"+"Not Interested"+"</option>");
combo.append("<option>"+"Call on Later"+"</option>");
  }
   if(obj.interest=="Call on Later")
  {
      //alert("Inside Call on later");
combo.append("<option>" + obj.interest + "</option>");
combo.append("<option>"+"Interested"+"</option>");
combo.append("<option>"+"Not Interested"+"</option>");
  }

I am then adding this dropdown in the table as,

    t.row.add( [
      obj.clientName,
      obj.companyName,
      obj.contactNumber,
      obj.emailId,
       companytype.companyType,
      category.categoryName,
      combo,
      obj.updatedDate
       //and so on as based on number of your columns
   ]).draw();

But the dropdown is not getting displayed in the table. Instead it shows "Object" in the table.

READ ALSO
jQuery datepicker default date null on postback

jQuery datepicker default date null on postback

I have a model that looks like this:

279
Can I Save Get Request Data To File?

Can I Save Get Request Data To File?

Is it possible, using JS/jQuery, to save data from my GET request to file?

127
Jquery Datatable Ordering with in each Group

Jquery Datatable Ordering with in each Group

I am facing a strange requirement in my project, we are using jQuery Datatable to display data with multiple groupsHere we need to order the items of a group by drag and drop but it should be with in the same group, should not be allowed to drag and drop to another...

194