asp.net - Add selected items from gridview to a list using Javascript -


I have some gridviews with a checkbox I want to get the items selected in the gridview to a different list. Please recommend me a Javascript library which can be useful. The examples below are: Please see the picture

You can use it Can Clone-node Dome method but it becomes very easy by using jQuery. Unischarte conceptual code:

  & lt; Script type = "text / javascript" src = "jquery-1.4.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("Input: checkbox"). Click (function () {if ($ (this) .is (': checked')) {var $ item = $ (" & Lt; li id ​​= \ "copy_" + $ (this) .attr ("id") + "\" & gt; "); $ item.text ($ (this) .Parent (). Text ()) ; $ ("#selectedList") attachments ($ item);} and {$ ("# copy_" + $ (this) .attr ("id"), "#selectedList") ();}})}} ); & Lt; / Script & gt;  

and in your HTML:

  & lt; Ul id = "itemList" & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" id = "one" /> A & lt; / Li & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" id = "two" /> Two & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul id = "selected list" & gt; & Lt; / Ul & gt;  

hH,

JS


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -