PDA

View Full Version : Change language / hideable column



MatthiasG.
22 Jul 2009, 1:17 AM
Hello there again!

Now I'm having only a little problem:
If your're using something like the sort-function of the grid, the text there is in english (Sort Ascending/Sort Descending/Columns). How to translate that into german?

And another little question: You can deselect columns, if you want. How can I forbid that?

MatthiasG.
22 Jul 2009, 6:47 AM
Has noone an idea how to do that?

tryanDLS
22 Jul 2009, 7:29 AM
Please don't bump your posts hours after posting.

Have you looked any of the localization stuff? See the examples\locale folder.

What do you mean deselect columns? Do you mean via the right click context menu? There are examples here of modifying that behavior - you'll have to do some searching.

Lukman
22 Jul 2009, 7:35 AM
Other than using localization, you can use the following config options under GridView:

columnsText
groupByText
sortAscText
sortDescText

You can customize them for each instance or use Ext.override() to apply to all instances.
Refer to API doc for description of each of them.

MatthiasG.
22 Jul 2009, 7:41 AM
@tryanDSL: Sorry, I did not check the time, I posted it...
I searched for that, but I think not with the right words (my English is not the best). For what I should search?

Thank you! Now I'm having it in German :)

VinylFox
22 Jul 2009, 7:44 AM
Did you happen to come across this page?

http://extjs.com/learn/Tutorial:Localizing_Ext

MatthiasG.
22 Jul 2009, 7:48 AM
No, I did not found that page. Thank you!

But with what words should I search to find, how to forbid deselecting columns like here:
15186

Lukman
22 Jul 2009, 7:55 AM
http://extjs.com/deploy/ext-3.0.0/docs/?class=Ext.grid.Column&member=hideable

MatthiasG.
22 Jul 2009, 7:59 AM
Thanks a lot Lukman!

I tried to use the parameters, but they just for gridview, I've got a grid-panel.

How to combine that two?

Lukman
22 Jul 2009, 8:08 AM
No. It's for use in GridPanel's column model.

VinylFox
22 Jul 2009, 8:12 AM
That is part of the Column model, so where you have specified your column model in your grid...


...
columns: [
{id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
{header: 'Price', width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
{header: 'Change', width: 120, sortable: true, dataIndex: 'change'}
],
...

you would add the hideable: false config...


...
columns: [
{id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
{header: 'Price', width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
{header: 'Change', width: 120, sortable: true, dataIndex: 'change', hideable: false}
],
...

MatthiasG.
22 Jul 2009, 9:42 AM
But in the API-Documentation I'm not seeing something like that under Column-Model. Am I making something wron?

tryanDLS
22 Jul 2009, 12:12 PM
http://extjs.com/deploy/dev/docs/?class=Ext.grid.Column&method=hideable

VinylFox
22 Jul 2009, 12:40 PM
Are you sure your looking at the "Ext JS" documentation, and not the "Ext Core" documentation?

The tree on the left will have an "Ext" item that expands to show "grid" which expands to show "ColumnModel". A "ColumnModel" is then made up of many "Columns" which is located under the same branch in the tree as "ColumnModel".

Hope that helps.

MatthiasG.
23 Jul 2009, 6:04 AM
Yes, that hideable: false, I found, but not the part with ColumnText, SortAscText, etc. :-/

Lukman
23 Jul 2009, 7:00 AM
Other than using localization, you can use the following config options under GridView:

columnsText
groupByText
sortAscText
sortDescText

You can customize them for each instance or use Ext.override() to apply to all instances.
Refer to API doc for description of each of them.
GridView
GridView
GridView

now repeat after me,GridView