Monday, October 22, 2012

ExtJS Tweak : Selecting first and last row of a grid

Very often we need to select a row by default in the grid, since some other pieces of code are linked to selection of the rows in grid , for example like charts rendering data in the grid and something like that.

The problem is the the first row in grid is not selected by default in ExtJS and we have to break our heads.
The event - 'viewready' is the answer. In the documentation , it is explicitly written to use this event to select a row in grid by default.

this small snippet of code will do the job(select the first row),
suppose you have defined your grid as 'grid', then:

 grid.on('viewready',function(){  
           this.getSelectionModel().select(0);  
      });  
Now we would also want some times to select the last row in case we have added a record. The following snippet will do the job beautifully.

 xmlgrid.getSelectionModel().select(store.getCount()-1);  
We have xmlgrid as the grid and "store" is name of data store attached to the grid.

Thursday, October 4, 2012

Verifying your domain in Google apps without hosting your domain

I recently registered a domain but did not host it. Then i registered myself with Google Apps for business and  found that i need to verify my domain for security purpose. Now, the question is how to upload the HTML file on my domain, which is the default method of Google verification process and which necessitates hosting. But there is also provision for verifying your domain without hosting, You need to look for "Alternative methods" pane.

Once into it, you will be provided with the list of domain Registrars (The people who provided you domain with). If your Registrar does not appears in the list choose "Others". If your Registrar appears, they will provide step by step method in their Instructions Pane.

Now for people whose registrars are not listed (which might hopefully get listed later), upon choosing OTHERS you will be given a CONFIRMATION CODE by google. Now login to your registrar website. In the web site look for "DNS server Management". In the various options you will get TXT Records, in this paste your value and save changes. Now you have to wait for few minutes before google can search your DNS.(8-10 mins). After this Verify on google and you are good to go!!