Speed-up data entry

Categories ASP.NET, PHP, Tutorials

We continue series of posts that show how to make you PHPRunner/ASPRunnerPro/ASPRunner.NET apps behave in Excel-like way. In this article we'll show how you can speed-up data entry in inline mode eliminating the need to click 'Inline Add' and 'Save' buttons multiple times.



Here is the code that needs to be added to List page: Javascript OnLoad event. Now you can click 'Inline Add' once and just type in your data pressing tab to move from field to field. This script does the rest of the job.

pageObj.addNewRecordsToBottom = true;  
  
th_id1 = "";  
th_id2 = "";  
th_key = 0;  
  
$("body").keydown(function(e) {  
    if(e.keyCode == 9){  
        pos = e.target.id.lastIndexOf("_");  
        if(pos>0)  
            th_key = e.target.id.substring(pos+1);  
    }  
});  
  
$("body").keyup(function(e) {  
    if(e.keyCode == 9) {  
        spanID = $(e.target).parent()[0].id.substring(0,4);
        if( spanID != "edit" && e.target.id.substring(0,6) != "radio_"){  
            $("#saveLink"+th_key).click();  
         $("#inlineAdd"+pageid).click();  
      }  
    }  
});

4 thoughts on “Speed-up data entry

  1. An article like this should have at least a little explanation of code. Looks like “if the keycode is something then the target is something.” The writer knows exactly what this does and should explain it.

  2. Terrific, only one aditional help, when y have two aditional tables using link properties (a master and two or more details) i am in the second table and add inline record, when press tab the site add a record to the first table. There are some aditional data to ensure this code works on the specific table.

    best regards
    Carlos.

  3. This could be very helpful to my project which is to replace an excel time sheet entry form where you have 1st column is a list of projects and top row are weekdays (like a calendar) Just need to figure out how to make the layout!

Leave a Reply

Your email address will not be published. Required fields are marked *