data table row select item to input text
data table row select item to input text
setint
Posts: 5Questions: 1Answers: 0
Hi
Data Table version 1.11.3
I want select item in table to input text write. How I do?
Thank you.
Answers
Use Editor with inline editing.
Here is an example and you'll find many more in the docs:
https://editor.datatables.net/examples/inline-editing/simple.html
Thank you @rf1234 .
But I want table select row items send to inputteexts
Samle
<input type="text" id="t1" />
<input type="text" id="t2" />
<input type="text" id="t1" />
from table selected >>>>>to input
Are you saying you want a table like this?
https://datatables.net/examples/plug-ins/dom_sort.html
Kevin
assuming t1 and t2 are the names of the respective columns in the data table.
If you want to do this when a row in the data table is being selected you can use this event:
Dear Sear @rf1234
Sory; I'm don't
<input type="number" id="t1" required />
<input type="text" id="t2" required />
<input type="text" id="t3" required />
My table id= "table1"
field = t1, t2, t3
Now
I selected table1 row. Row field transfer t1,t2,t3
Your scrip
var selected = table1.row({ selected: true }); $('#it1').text(selected.data().t1); $('#t2').text(selected.data().t2); $('#t3').text(selected.data().t3); icd10 .on('select', function (e, dt, tp, indexes) { var selected = dt.row({ selected: true }); $('#t1').text(selected.data().t1); $('#t2').text(selected.data().t2); $('#t3').text(selected.data().t3); });BUT NOT WORK . please can you help me? Thank you
Are you using the Select extension? It is required for the above code.
If you still need help please build a test case showing what you have so we can provide specific help.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Dear @kthorngren and @rf1234
http://live.datatables.net/vozezumi/1/edit?html,css,js,console,output
http://live.datatables.net/vozezumi/1/
I added the Select extension library. See the HTML tab. I updated the code to show populating the value of a text input from the data in the selected row.
http://live.datatables.net/vozezumi/2/edit
Kevin
Thank you very much you and @rf1234 is very good experts. Loves from Turkey.