Skip to content
Loading
  
  •       
  •   
  •   
  • "text/javascript">  
  •     $(document).ready(function () {  
  •         $(document).on("click", ".classAdd", function () {  
  •             $(gridView).show();  
  •             //on is used for getting click event for dynamically created buttons  
  •             var rowCount = $('.data-contact-person').length + 1;  
  •             var contactdiv = '' +  
  •                 ' + rowCount + '" class="f-name01">' + $("#textBox1").val() + '' +  
  •                 ' + rowCount + '" class="l-name01">' + $("#textBox2").val() + '' +  
  •                 ' + rowCount + '" class="email01">' + $("#textBox3").val() + '' +  
  •                 'Remove' +  
  •                 '';  
  •             $('#maintable').append(contactdiv); // Adding these controls to Main table class  
  •             $("#textBox1").val('');  
  •             $("#textBox2").val('');  
  •             $("#textBox3").val('');  
  •         });  
  •   
  •         $(document).on("click", ".deleteContact", function () {  
  •             $(this).closest("tr").remove(); // closest used to remove the respective 'tr' in which I have my controls   
  •         });  
  •     });  
  •   
  • "text/javascript">  
  •     $(function () {  
  •         $("#maintable").sortable({  
  •             items: 'tr:not(tr:first-child)',  
  •             cursor: 'pointer',  
  •             axis: 'y',  
  •             dropOnEmpty: false,  
  •             start: function (e, ui) {  
  •                 ui.item.addClass("selected");  
  •             },  
  •             stop: function (e, ui) {  
  •                 ui.item.removeClass("selected");  
  •             }  
  •         });  
  •     });  
  •   
  •  
  • +1
  • Laxmidhar Sahoo
    +1
    hey
    In which base you reorder the row whether alphabetic or something else 
    +1
  • Amit Mohanty
    0
    Hey to clear the textbobes add the below code after $('#maintable').append(contactdiv); line.
    1. $("#textBox1").val('');  
    2. $("#textBox2").val(''); 
    0
  • 0
    Hi Amit,
     
    Thank you for your response, I want to drange the row RAJ and F need to come first, Need to give the drage action on the grid view...
     
    Thank you in advance!!

     
    0