Showing posts with label rui. Show all posts
Showing posts with label rui. Show all posts

Tuesday, May 27, 2014

ExtJS: Panel Vs ViewPort

Working with ExtJS apps, we often get advice from the senior programmers that we should use ViewPort instead of Panel.
So, the question that we arise is when to use a ViewPort and when to use a Panel. Or, why to use ViewPort if Panel suffice the need.

Well, ViewPort is particularly useful in case you are looking to create a single web page application.
I think designers of ExtJS have put together all the essential components very nicely which allows you to develop Single Page WebApp quite elegantly.

Using viewport you can utilize availbale height and width of browser. You can use screen.availWidth and screen.availHeight to give you component proper dimension.

When I tried to do a little bit of search on google and forms, couple of interesting points came out which can help understanding answer when and why:
  1. There may be only one ViewPort for a page for obvious reason that it is specialized container which give you the entire view area of browser. But of course you can use a layout like border layout and add Panels as child component.So, in case you have a
  2. And, in cases where you do not have the liberty of using the entire view of the document/web page, use Panel instead. For example, in case your entire web page is using JQuery, but you want to keep a ExtJS grid component, you can do so using a grid panel.
     
The below forum links might useful to further reading:
The only tricky thing that I found with ViewPort is when you want to have the scrolling option, meaning the scrollbars should appear when you reduce the browser window size.
There is  autoScorll config, which is by default false. Although there implies that if you make it true it should show you the scrollbars. But, that does not happen often. The reason is something interesting to know.

If you take a look at the docs for ExtJS (4.x), it clearly states, "The Viewport does not provide scrolling, so child Panels within the Viewport should provide for scrolling if needed using the autoScroll config."


All this is little contradictory. But the problem gets solved once you provide the width/height or both for the child Panels. The scrollbar does appear after that.

So, in case you want to keep the scrolling, you need to take care of child Panels.
-----------------------------------------------------------------------------
  1. Please note the properties in EtxJS are case-sensitive, so "autscroll" won't work, it must be "autoScroll".
  2. screen.availWidth and screen.availHeight are provided by java script. You can alternatively use Ext.container.Viewport.getWidth() and Ext.container.Viewport.getHeight() as well.

Monday, October 1, 2012

RUI (Rich User Interface): The buzz..and The Players!!


User Interface ‘has been’, ‘is’ and ‘will be’ one of the most important aspects of web application development. Now a day, for mobile app development as well. Also, it is one of most important criteria for ‘user/business acceptance’ as well as ‘end user delight’.

Well..a lot of pleasant sounding terms above, but, how do we accomplish this? The answer is RUI…or Rich User Interface.

Enterprises have been spending a lot in developing their own standards and APIs for RUI. However, underneath this, it’s the blend of CSS and some Java Script API.

Some of the popular RUI frameworks available in market are ExtJS, Jquery, Prototype, Flex, YUI and Dojo. Each of them has its own pros and cons. Hence, it’s important to evaluate and decide on one of them before you go ahead with actual development, as per your need. Also, keep in mind the learning curve involved with each of them.
  
One of my favourites is ExtJs. So, following this post, I am going to write more about ExtJS. For now, introducing ExtJS. Here it goes:


ExtJS (pronounced as E-X-T-J-S) is a Rich User Interface framework, provided by Sencha (http://www.sencha.com). And, this is one of most used UI frameworks in the market today.

Interestingly, it comes with both open source as well as commercial license.

It has many rich look components, which are quite extensible. And, plenty of powerful features such as AJAX, DOM Manipulation, Communication Support for REST, Good looking Charts (rendered using SVG).

Object Oriented (Class based) approach allows you to make your own custom component by extending existing components. Further, MVC based approach allows you to make your UI layer modular and extremely maintainable. What’s more? You are bound to get rid of your FAT ugly looking JSPs (or server side scripts).

Further details can be found at http://www.sencha.com/products/extjs/

Watch this space, for more on ExtJS. J



Prototype

Prototype is another creation pattern. Intent:  - Intent is to create objects by cloning existing instance  - Specify the kinds of obj...