title: How to pass DataTable data to a Bootstrap modal
body: <p>I have a jQuery Data Table with this variable:</p>
  
  <pre><code> "columns":  [
                      { "data": "id" },
                      { "data": "date" },
                      { "data": "type" },
                      { "data": "name" },
                      { "data": "user_name" },
                      { "data": "status" },
                      { "data": "closing_date" },
                      { "data": "info" },
                      { "data": "note" },
                      { "render": function () {
                              return "&lt;button type='button' class='btn btn-info btn-md' data-toggle='modal' data-id=\""+data.id+"\" data-target='#myModal'&gt; Edit &lt;/button&gt;";
                      }
                    }
                  ]
  </code></pre>
  
  <p>That shows the results of the query perfectly. As you can see, at the end oh the table appear a column with a edit button that must allow a user to modify note and status; this modified data must be send to a Spring controller with the id of the data to modify.</p>
  
  <p>My problem is not how to send to controller; i solved this problem thanks to an user here on stack. </p>
  
  <p>My problem is: if I want that <code>{ "data": "id" }</code> will be used, in modal, to set the <code>data-id</code> on the button that trigger the modal, what syntax must I use? The actual syntax make me an error that tells "data is not defined" when I load the app. Seems that if I use the actual value, <code>data-id=\""+data.id+"\"</code>, it don't recognize the data. notation to recall the data of data table columns. </p>
  
  <p>EDIT: the markpsmith answer solve the problem of data not defined but I have still problems. 
  His solution introduce another issue: now, when I submit form data, i got un "undefined" value on id. Analyzing the element i can note that it's undefined before I submit data form; immediately after the page is load, inspecting the button the value is undefined.</p>
  
  <p>I've tried other solution found on web, but the problem is always the same: all the data and combination that I put on data-id are not recognized and this value is set to undefined.</p>