First Last

First Last

  • NA
  • 648
  • 72.4k

jQuery datatable - how to get a value from a selected row

Dec 7 2020 8:57 PM
I have a jQuery datatable and when I click a row, I want to get a value from one of the columns in the clicked row.
 
I have a function for the click event of the row so here I would like to get a column of that row.
I enter into this function when a row is clicked just fine.
 
Here is the view (not in its entirety) with the datatable and click event function.
  
Note: I build each rows href just fine and there I use row.columnname for the columns I need to build my query string. I get the href in my clicked function and I know I can just substring the PublishedSwitch out of the href. However, I will no longer be building that query string and hence it will not be part of the href. So I now need to get that row's publishedSwitch somehow from within the clicked function.
  1.     @section Scripts  
  2.     {  
  3.     <!-- Inject Script Filtered -->  
  4. }  
 

Answers (3)