Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <input type="hidden" id="gridview_ids" />
  2.  
  3. $("<gridview class>tr").click(function()
  4. {
  5.     var currentClass = $(this).attr("class");
  6.     if(!strpos(currentClass, "selected")) //meaning that the row is not selected yet.
  7.     {
  8.         $(this).appendClass("selected");    //setting row selected. Meanwhile css changes the rows color.
  9.     }
  10.     else
  11.     {
  12.         $(this).removeClass("selected");    //setting row unselected.
  13.     }
  14.  
  15.  
  16. });
  17.  
  18. //Once submit is clicked
  19.  
  20.  
  21. //looking for all tr rows which are selected. Then looking for id and appending
  22. foreach($("#cgridview").children("tr.selected"), function()
  23. {
  24.     $("#gridview_ids").val(("#gridview_ids).val() + "," + $(this).children("...looking the column that contains id").val();     //appeding id list.
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement