Introduce ext Js in Vista gadget

Source: Internet
Author: User

Extjs UI is widely used on different client hosts! Complete the UI framework after the UI. Theoretically, extjs UI can be run only in an HTML/CSS/JavaScript environment, so we can see clients other than the Web: mobile terminals, WebOS, and fireware (such as routers and even Nintendo Wii. In this case, it is more convenient and convenient to apply it on the gadget. So what will happen to the gadget? We can use MS Vista gadget and Google gadget to see what happened after the combination of extjs.

Extjs's predecessor, Jack Slocum, once wrote a blog post (http://jackslocum.com/blog/2008/02/15/vista-gadget-with-ext-js/) saying extjs can be directly used on Vista operating systems. Here, "direct" means that it is not as simple as using extjs on a webpage, nor is it used in wsh or HTA, but through the concept of "gadget gadgets" supported by Vista, to build a small OS-based application. The development approaches supported by gaget include HTML, CSS, and Javascript. Therefore, extjs is used as an Ajax
UI framework, you can make full use of Vista's operating system "native" extension.

Jack provided a demo program in the blog. It is an ext Forum content reading gaget program. You do not need to open a browser, you can log on to the website to learn about the Forum posts on the "desktop.

As shown in, gaget in undocked state is displayed on the left, and gaget in docked state is displayed on the right:

The process of making gaget is not very complex. According to Jack's self-report, the only difference is to package the ext program into a Gadget program. Besides writing several lines of docked/undocked Code, there is no specific code for the Gadget program. The packaging process is the "compilation process" for releasing each application, which is always indispensable. MS gadget is actually a type of ZIP file, change the original Forum. Gadget extension to *. Zip open it, there are source code (Forum. JS ).

function changeDock() {if (System.Gadget.docked) {System.Gadget.background = 'images/docked.png';var bd = Ext.getBody();bd.setSize(130, 250);bd.addClass('docked');cm.setHidden(1, true);cm.setRenderer(0, renderTopicMini);grid.setPosition(4, 4);grid.setSize(121, 241);toggleDetails(null, false);} else {System.Gadget.background = 'images/undocked2.png';var bd = Ext.getBody();bd.setSize(528, 383);bd.removeClass('docked');cm.setHidden(1, false);cm.setRenderer(0, renderTopic);grid.setPosition(14, 14);grid.setSize(494, 349);cm.setColumnWidth(0, 350);toggleDetails(null, true);}}System.Gadget.onUndock = changeDock;System.Gadget.onDock = changeDock;

Let's explain the code. The gaget API provides ondock/onundock events. Here we all point to the same event processor: changedock (). In the event handler changedock, the status of system.gadget.doc ked determines whether to contract the gaget control. Note that the background image of the gadget control cannot be set by BOD: Background-image, but by the background attribute system. Gadget. Background of the gadget control. The last step is to change the widget size.

Some netizens asked that visit gadget is only limited to the MS Platform. If you do not use Vista or a later OS, you cannot use gadget, but Google's gadget does not, so can this gadget be changed to Google's gadget (http://code.google.com/apis/gadgets/index.html )? Jack quickly replied to the netizen and said that, in fact, there are still Ajax programs inside the gadget, and the Code for the specific platform of the gadget is a small part, so it is transferred to the space on the Google Page, it should not be too difficult and troublesome.

 

Download the gadget application: http://jackslocum.com/playpen/forum.gadget

Backup download: http://bbs.ajaxjs.com/viewthread.php? Tid = 3140

 

Several related URLs:

  • The http://msdn.microsoft.com/en-us/library/aa965853 (vs.85). aspx
    Msdn documentation on sidebar
  • Http://social.msdn.microsoft.com/forums/en-US/sidebargadfetdevelopment/threads/
    Official gadget Forum
  • Http://gallery.live.com/home.aspx
    There are a lot of gadget applications in live Gallery.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.