Extjs allign only cell text to right

There is a config present for numbercolumn known as align. just use that.

Whenever you are stuck refer the secha docs which is beautifully designed just for beginners.

I am assuming you are beginner and explaining you how to use docs.. for your clear understanding:

  • First go to search field, to search for a component, method, or event or something else.

enter image description here


  • In your case, let us assume that you have searched for "numbercolumn", then you can see the following window which displays all the cofigs, properties, methods etc.. Just hover on them and know what "numbercolumn" is related with.
  • In your case, you are looking for a config which align's the text to right. then you are mostly looking for key words like txtAlign, align, textAlign, etc..
  • Hence, you will find a config, which is by name "align". just click on it to learn more about it.

enter image description here


  • After learning about the cofig "align", you might want to test it. For this purpose, the docs have provided inline code editor which is shown in the below image.
  • The code editor has two tabs, "code editor" and "live preview". The words says everything.
  • Just add your changes in "code editor" tab and see your result in "live preview" tab.

enter image description here


  • For example, Adding align: "right" code in the below "code editor".

enter image description here


Updated

CSS:

.columnAlign{
     text-align: right;
}

extjs

tdCls: "columnAlign",

As answered Mr_Green you can align the text to the right or left using align. For header to remain centrally aligned use css as :

.x-column-header-inner{
    text-align:center;
 }

Update :

.....//

  {
    xtype : 'grid',
    cls   : 'gridCss',
    ...//other configs
  }

.....//

In your app.css file :

 .gridCss .x-column-header-inner{
    text-align:center;
 }

In your index.jsp

<link rel="stylesheet" type="text/css" href="app/resources/css/app.css">