Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="hidden" id="gridview_ids" />
- $("<gridview class>tr").click(function()
- {
- var currentClass = $(this).attr("class");
- if(!strpos(currentClass, "selected")) //meaning that the row is not selected yet.
- {
- $(this).appendClass("selected"); //setting row selected. Meanwhile css changes the rows color.
- }
- else
- {
- $(this).removeClass("selected"); //setting row unselected.
- }
- });
- //Once submit is clicked
- //looking for all tr rows which are selected. Then looking for id and appending
- foreach($("#cgridview").children("tr.selected"), function()
- {
- $("#gridview_ids").val(("#gridview_ids).val() + "," + $(this).children("...looking the column that contains id").val(); //appeding id list.
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement