![]() I’d be happy to share the code if anyone wants to try to adapt it to their own use. I either found it here on this forum or put it together from other sources online. I’m sure I didn’t come up with this myself - some of the comments in the code were definitely written by someone else. It uses the percentage to update the progress bar and displays the message below it. The first blank app refreshes every 250ms and it reads from the JSON array in the text file. “.csv”) to a JSON encoded array in a text file. On each loop the PHP in the second control runs a stored procedure on the SQL server to import the CSV, passing a filename parameter that is based on the dates in the array.ĭuring each loop, the second blank app writes the percentage complete and a message to be displayed on the screen ("Currently processing file ". The total number of files to be processed is the count of members of the array, so the current progress percentage is the counter divided by the total. In increments a counter each time it loops. The second blank app has a ‘foreach’ loop that goes through each date in the array that was passed from the original control. The control redirects to the first blank app which contains HTML/AJAX, and that calls the 2nd blank app that runs the PHP to do the task. As an example, we have a control-type application with two select fields ('state' and 'city'), where when we select the state we will use ajax processing. That matches the date format in the csv filenames. Run the app and see its operation: Updated: 3 years ago Helpful In this article we will learn how to use the 'Ajax Processing' function available in Scriptcase. ![]() So if the user selected 3/28 as the start and 3/30 as the end, the array would be ~. The onValidate of the control sets all of the dates between the start and end date in a global variable containing an array of each date. The use case is to loop through a set of daily csv log files and load the data into a temp table to do some database operations and display the results in a grid.Ī user selects a start date and an end date in a control application along with some other parameters that will be used to filter the data from the csv. JS Graphics JS Graphics JS Canvas JS Plotly JS Chart.js JS Google Chart JS D3.I was able to do this using two blank applications. JS vs jQuery jQuery Selectors jQuery HTML jQuery CSS jQuery DOM JS JSON JSON Intro JSON Syntax JSON vs XML JSON Data Types JSON Parse JSON Stringify JSON Objects JSON Arrays JSON Server JSON PHP JSON HTML JSON JSONP JS AJAX AJAX Intro AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples JS Web APIs Web API Intro Web Forms API Web History API Web Storage API Web Worker API Web Fetch API Web Geolocation API See Tutorial Try it now on mobile device Point your cell phone camera at the QR Code to view this example on your mobile device. JS Browser BOM JS Window JS Screen JS Location JS History JS Navigator JS Popup Alert JS Timing JS Cookies Home Forms Ajax processing Ajax processing ctrlajaxbtn see complete description Execute lines of code using Ajax processing by clicking in a customizable button. JS HTML DOM DOM Intro DOM Methods DOM Document DOM Elements DOM HTML DOM Forms DOM CSS DOM Animations DOM Events DOM Event Listener DOM Navigation DOM Nodes DOM Collections DOM Node Lists ![]() JS Async JS Callbacks JS Asynchronous JS Promises JS Async/Await ![]() JS Classes Class Intro Class Inheritance Class Static JS Functions Function Definitions Function Parameters Function Invocation Function Call Function Apply Function Bind Function Closures JS Objects Object Definitions Object Properties Object Methods Object Display Object Accessors Object Constructors Object Prototypes Object Iterables Object Sets Object Maps Object Reference JS Tutorial JS HOME JS Introduction JS Where To JS Output JS Statements JS Syntax JS Comments JS Variables JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Data Types JS Functions JS Objects JS Events JS Strings JS String Methods JS String Search JS String Templates JS Numbers JS BigInt JS Number Methods JS Number Properties JS Arrays JS Array Methods JS Array Search JS Array Sort JS Array Iteration JS Array Const JS Dates JS Date Formats JS Date Get Methods JS Date Set Methods JS Math JS Random JS Booleans JS Comparisons JS If Else JS Switch JS Loop For JS Loop For In JS Loop For Of JS Loop While JS Break JS Iterables JS Sets JS Maps JS Typeof JS Type Conversion JS Bitwise JS RegExp JS Precedence JS Errors JS Scope JS Hoisting JS Strict Mode JS this Keyword JS Arrow Function JS Classes JS Modules JS JSON JS Debugging JS Style Guide JS Best Practices JS Mistakes JS Performance JS Reserved Words
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |