tailieunhanh - JavaScript Bible, Gold Edition part 159

JavaScript Bible, Gold Edition part 159. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 1428 Part V Putting JavaScript to Work described earlier is invoked several times again to derive the quota percentage for the accumulated grand total values in each quarter as well as the complete year. SELECT controls To round out the code listing for this application the values assigned to the two SELECT elements obviously have a lot to do with the execution of numerous functions in this application. Nothing magic takes place here but you can see the extent of the detail required in assigning script-meaningful hidden values and humanmeaningful text for both SELECT elements. For example dividing lines help organize the long sort key list into three logical blocks. SELECT ID sortChooser onChange selectSort this VALUE byRep Representative VALUE byRegion Sales Region VALUE --------------------- VALUE byQ1Fcst Q1 Forecast VALUE byQ1Actual Q1 Actual VALUE byQ1Quota Q1 Performance VALUE byQ2Fcst Q2 Forecast VALUE byQ2Actual Q2 Actual VALUE byQ2Quota Q2 Performance VALUE byQ3Fcst Q3 Forecast VALUE byQ3Actual Q3 Actual VALUE byQ3Quota Q3 Performance VALUE byQ4Fcst Q4 Forecast VALUE byQ4Actual Q4 Actual VALUE byQ4Quota Q4 Performance VALUE --------------------- VALUE byTotalFcst Total Forecast VALUE byTotalActual Total Actual VALUE byTotalQuota Total Performance P Sort by OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION OPTION SELECT nbsp nbsp Ordered SELECT ID orderChooser onChange selectOrder OPTION VALUE inc Low to High OPTION VALUE dec High to Low SELECT P Dreams of Other Views Confining the example to just one type of view a table of numbers should help you grasp the important processes taking place. But with the XML data converted to JavaScript objects you can build many other views of the same data into the same page. For example a script could completely hide the numeric table and generate a different one that draws bar charts for each sales representative or each region see Chapter 55 .

TỪ KHÓA LIÊN QUAN