Archive

ExtJS 4 contains the field type “numberfield” to enter numbers. If the numbers have a lot of digits, this field can create problems. On this occasion, it can help a text field (“textfield”) with a filter for input only numbers.

Within the setting properties of the text field, enter the attribute “maskRe”. It allows you to create masks with regular expressions. Here is a mask that allows you to enter only the numbers:

When turned on paging (Pagination object) within the grid object receives the full range of tools for navigation. Once I had a request to turn off the refresh button on this line and move it to the toolbar located above the grid object. The procedure would be as follows:

First you need to exclude refresh button in the navigation as follows:

The point is to follow the event “afterRender”, more precisely, to wait until the object is displayed on the page. Then, the hides a button whose itemId is “#refresh”. Similarly, you can disable any of the elements in the navigation.

After this, insert a refresh button to the toolbar and in handler add:

Version 4 instead of scrolling which creates browser uses his scroll. It often happens that in its content “freeze”. Version 4.1 is returned to the natural scroll. For those who still use some of the 4.0.x version here’s the solution:

If you need to Grid object react by clicking on a specific cell, not the entire row, this post is for you. It was first implemented into the ExtJS 3. On this occasion used the index of the column, can not use the name of the column used for the header.

Example of adding events would be:

listeners: {
cellclick: function(gridView,htmlElement,columnIndex,dataRecord)
{
if(columnIndex == 3) {
// Here insert the code that will be executed
// when you click on the 4th column in the Grid object
}
}
}

The third version of the popular work environment existed attribute for this action. It is tabTip attribute. In version 4 is thrown but here are two suggestions on how to do this.
The first uses tabConfig attributes as follows: