Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 469.8k

How to do dropDownlist using DataTable on Jquery?

Feb 17 2020 2:42 AM
Hi Team
 
I need some helpe below, basically i want to get dropdownlist for WhoAttend column, but my dropdownlist doesnt seem to work as expected. Need some improvement to this logic below, please mates.
  1. $(document).ready(function () {  
  2.   
  3.          $("#EventsManagementsTable").DataTable({  
  4.   
  5.              "columnDefs": [  
  6.              { "width""5%""targets": [0] },   
  7.              { "className""text-center custom-middle-align" ,"targets":[0, 1, 2, 3, 4, 5, 6] },  
  8.              ],  
  9.   
  10.              "serverSide""true",  
  11.              "order":[0,"asc"],   
  12.              "processing""true",  
  13.              "language": {  
  14.                  "processing""processing...... please wait"  
  15.              },  
  16.              "ajax": {  
  17.                  "url""/Dashboard/GetData",  
  18.                  "type""POST",  
  19.                  "datatype""JSON",  
  20.     
  21.              },  
  22.   
  23.             "columns": [  
  24.              {"data""TrainingType""name""TrainingType"},  
  25.              { "data""TrainingDescription""name""TrainingDescription"},  
  26.              { "data""Price""name""Price"},  
  27.              { "data""Venue""name""Venue"},  
  28.              { "data""Facilitator""name":"Facilitator" },  
  29.              { "data""WhoAttend""name" : "WhoAttend" },  
  30.              {"data""RSVP""name":"RSVP" },  
  31.                 {  
  32.              className: "center",  
  33.              defaultContent:`<select name='slcCustom' class='custom' >  
  34.                <option value='default'>select something</option>  
  35.                <option value='1'>Apple</option>  
  36.                </select>`  
  37.            }  
  38.             ]  
  39.                
  40.   
  41.          });  
  42.   
  43.      });  
 

Answers (3)