Getting Value of a Column/Cell from SelectTable
Getting Value of a Column/Cell from SelectTable

Greetings! My question is probably easily answered however I am relatively working in MVC as a student and have this issue so forgive me if this is a silly question - I am trying to get the value of a specific cell in a selected row in what's called a "Select Table". What do I do to get the value to a variable that I will use in Razor to create a modal card that contains some of that row data based on the ID column/cell.
For example:
ProjectID | Project Manager | Developers | Status | Description|
1 Sally Jim New Blah
2 Mike Sue Planning Bleh
3 Bob Jack Deployment YaddaYadda
When I select Row 2 I want to use the ID cell from that selected row to populate another view above the table. Make sense?
Answers
Here you are: https://datatables.net/reference/api/row().id()
And you would also need the select extension:
https://datatables.net/reference/option/select
Then you could do something like this:
Why "substr(4)"? Data Tables has the row ids like this "Row_123".
Another example where I am getting the value of a certain cell which is not the ID. The column has a class ".ft":
https://datatables.net/reference/api/cell()
https://datatables.net/reference/api/cells().select()
If you want the data of an entire column use this:
https://datatables.net/reference/api/column().data()