{"id":1900,"date":"2024-12-30T12:33:27","date_gmt":"2024-12-30T04:33:27","guid":{"rendered":"https:\/\/www.tonghin.com.my\/blog\/?p=1900"},"modified":"2024-12-30T12:33:29","modified_gmt":"2024-12-30T04:33:29","slug":"week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page","status":"publish","type":"post","link":"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/","title":{"rendered":"Week 11 Internship : Find solutions for listen to print button and Create Default page"},"content":{"rendered":"\n<h2>Solution for listen button in print preview<\/h2>\n\n\n\n<p>This week, my main task was finding a solution to listen for the print preview button. I was working on calling the\u00a0print count async function when the user clicks the print button. However, this button appears in the print preview, which is a default browser feature. Due to privacy and security restrictions, we cannot access or listen to the button in the print preview. Before arriving at this conclusion, I explored numerous components and libraries to meet the requirements. However, after several days of research, I found that this approach is not feasible with JavaScript.<\/p>\n\n\n\n<h2>Create Default page<\/h2>\n\n\n\n<p>In addition to that, I worked on creating a retail default page. This page includes default data such as customer, tax, delivery method, etc., which are required for form completion. However, since some customers prefer not to provide their information, these default values can be automatically filled in when the required fields are null or left blank. I also implemented functionality to save this data into local storage. This task took me two days, as I was unfamiliar with saving data to local storage and had to conduct some research. Eventually, I succeeded in saving data to local storage, retrieving it on another page, and using it seamlessly.<\/p>\n\n\n\n<h2>Fix Bugs<\/h2>\n\n\n\n<p>During the remaining time, I focused on fixing bugs listed on the progress tracker. First, I adjusted the size of the select box in the order create\/edit view to make it larger and more user-friendly. Additionally, I worked on adding a confirmation dialog to the return reason line item selection. This feature prevents users from accidentally unchecking a box by displaying a confirmation prompt. Implementing this task took considerable time as I had to figure out how to listen for the event and trigger the dialog when the user attempts to unselect a checkbox. After multiple attempts, I finally managed to make it work smoothly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Solution for listen button in print preview This week, my main task was finding a solution to listen for the print preview button. I was working on calling the\u00a0print count async function when the user clicks the print button. However, this button appears in the print preview, which is a default browser feature. Due to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Week 11 Internship : Find solutions for listen to print button and Create Default page&#8221;<\/span><\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Week 11 Internship : Find solutions for listen to print button and Create Default page | Tong Hin&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Week 11 Internship : Find solutions for listen to print button and Create Default page | Tong Hin&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Solution for listen button in print preview This week, my main task was finding a solution to listen for the print preview button. I was working on calling the\u00a0print count async function when the user clicks the print button. However, this button appears in the print preview, which is a default browser feature. Due to &hellip; Continue reading &quot;Week 11 Internship : Find solutions for listen to print button and Create Default page&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\" \/>\n<meta property=\"og:site_name\" content=\"Tong Hin&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-30T04:33:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-30T04:33:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\",\"name\":\"TONG HIN MACHINERY\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"sameAs\":[\"https:\/\/www.youtube.com\/channel\/UC60EoxJMNbu8mV0LuEGfrBg\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/wp-content\/uploads\/2020\/10\/web_logo_180_180.jpg\",\"width\":180,\"height\":180,\"caption\":\"TONG HIN MACHINERY\"},\"image\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Tong Hin&#039;s Blog\",\"description\":\"Sharing About Technology\",\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.tonghin.com.my\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#webpage\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\",\"name\":\"Week 11 Internship : Find solutions for listen to print button and Create Default page | Tong Hin&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\"},\"datePublished\":\"2024-12-30T04:33:27+00:00\",\"dateModified\":\"2024-12-30T04:33:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/\",\"name\":\"Week 11 Internship : Find solutions for listen to print button and Create Default page\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/82e50d07ae9805ba50acb9b2b3e62388\"},\"headline\":\"Week 11 Internship : Find solutions for listen to print button and Create Default page\",\"datePublished\":\"2024-12-30T04:33:27+00:00\",\"dateModified\":\"2024-12-30T04:33:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/12\/30\/week-11-internship-find-solutions-for-listen-to-print-button-and-create-default-page\/#webpage\"},\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"articleSection\":\"Experiential\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/82e50d07ae9805ba50acb9b2b3e62388\",\"name\":\"Lit Jay Ong\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7e09b4361520d9e5e18a15b258eaf241?s=96&d=mm&r=g\",\"caption\":\"Lit Jay Ong\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1900"}],"collection":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/comments?post=1900"}],"version-history":[{"count":2,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1900\/revisions"}],"predecessor-version":[{"id":1919,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1900\/revisions\/1919"}],"wp:attachment":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/media?parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/categories?post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/tags?post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}