{"id":1383,"date":"2016-01-21T17:29:37","date_gmt":"2016-01-21T22:29:37","guid":{"rendered":"http:\/\/xlinesoft.com\/blog\/?p=1383"},"modified":"2020-05-13T12:12:45","modified_gmt":"2020-05-13T17:12:45","slug":"speed-up-data-entry","status":"publish","type":"post","link":"https:\/\/xlinesoft.com\/blog\/2016\/01\/21\/speed-up-data-entry\/","title":{"rendered":"Speed-up data entry"},"content":{"rendered":"<p><strong>Note:<\/strong> this code was updated and is compatible with version 10.x of PHPRunner, ASPRunner.NET and ASPRunnerPro. <\/p>\n<p>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&#8217;ll show how you can speed-up data entry in inline mode eliminating the need to click &#8216;Inline Add&#8217; and &#8216;Save&#8217; buttons multiple times. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2016\/01\/speed_up_data_entry.gif\" alt=\"\" title=\"speed_up_data_entry\" width=\"618\" height=\"391\" class=\"alignnone size-full wp-image-1384\" srcset=\"https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2016\/01\/speed_up_data_entry.gif 618w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2016\/01\/speed_up_data_entry-300x189.gif 300w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2016\/01\/speed_up_data_entry-150x94.gif 150w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2016\/01\/speed_up_data_entry-400x253.gif 400w\" sizes=\"auto, (max-width: 618px) 100vw, 618px\" \/><br \/>\n<!--more--><br \/>\nHere is the code that needs to be added to <strong>List page: Javascript OnLoad<\/strong> event. Now you can click &#8216;Inline Add&#8217; once and just type in your data pressing tab to move from field to field. This script does the rest of the job.<\/p>\n<pre name=\"code\" class=\"javascript:nocontrols\">\r\n    pageObj.addNewRecordsToBottom = false;      \r\n      \r\n    if($(\"[data-itemtype=pagination]\").length==0)  \r\n        $(\"<a id='lastelem' href='#'><\/a>\").insertAfter($(\"body\").find(\"div\").last());  \r\n         \r\n    th_id1 = \"\";      \r\n    th_id2 = \"\";      \r\n    th_key = 0;    \r\n      \r\n    $(\"body\").keydown(function(e) {    \r\n        if(e.keyCode == 9){  \r\n            if(e.target.id.substring(0,6) != \"radio_\"){  \r\n                pos = e.target.id.lastIndexOf(\"_\");      \r\n                if(pos>0)      \r\n                    th_key = e.target.id.substring(pos+1);      \r\n            }  \r\n            else{  \r\n                pos = e.target.id.lastIndexOf(\"_\");      \r\n                elem = e.target.id.substring(0,pos);      \r\n                pos = elem.lastIndexOf(\"_\");      \r\n                if(pos>0)      \r\n                    th_key = elem.substring(pos+1);      \r\n            }  \r\n        }      \r\n    });      \r\n         \r\n    $(\"body\").keyup(function(e) {      \r\n        if(e.keyCode == 9) {      \r\n             spanID = $(e.target).parent()[0].id.substring(0,4);  \r\n\t     var multiselect = false;\r\n\t     if(e.target.id==\"\" && $(e.target).closest(\"div\").siblings(\"select\").attr(\"multiple\")==\"multiple\")\r\n\t\tvar multiselect = true;\r\n             if( spanID != \"edit\" && e.target.id.substring(0,6) != \"radio_\" && e.target.id.substring(0,6)!=\"addnew\"  && !multiselect){      \r\n                $(\"#saveLink\"+th_key).click();      \r\n                $(\"#inlineAdd\"+pageid).click();      \r\n            }      \r\n        }      \r\n    });     \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Note: this code was updated and is compatible with version 10.x of PHPRunner, ASPRunner.NET and ASPRunnerPro. 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&#8217;ll show how you can speed-up data entry in inline mode eliminating the need to click &#8216;Inline Add&#8217; and &#8216;Save&#8217; buttons multiple times.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,1,8],"tags":[],"class_list":["post-1383","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-php-category","category-tutorials"],"_links":{"self":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/comments?post=1383"}],"version-history":[{"count":13,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1383\/revisions"}],"predecessor-version":[{"id":2279,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1383\/revisions\/2279"}],"wp:attachment":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/media?parent=1383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/categories?post=1383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/tags?post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}