ChangeLanguage method


with this method ErgoDataGrid modifies working language as the argument passed as parameter;
the rows with table column headers and with the visualized data change, all the tooltip and the criterions name in the list shown after the final user right click in one of the filter field (the row that appear pressing ) change too;
language property becomes equal to the method argument;
for the language to change must be present in the inizialization file (the example for "Cars" table foresees the Grid object inizialization into the file Cars.js) an ArrayGrid array with the name:

   language_abbrevation + "ArrayGrid" + name

which defines grid on the basis of the estabilished language by the final user or by code.


   Sintax

ErgoDataGrid.ChangeLanguage (lang)



   Parameters

lang   String with the language code abbreviated ( "it" = Italiano, "en" = English ) that refear to the various ArrayGrid contained in the inizialization file.



Example

This exaple starts from the ArrayGrid declaration for italian language in the itArrayGridCars variable; with the function CopyArray() is made an array copy for english language: fields that change are that relative to every column title in the enArrayGridCars[x][0] grid and the string that appear on the status bar at every mouse over column headers (enArrayGridCars[x][6]);
after Grid object declaration, ErgoDataGrid works in italian: ChangeLanguage("en") calling says to the grid to work in english and make change main table column title without reload it.

var itArrayGridCars=[["Foto","img_url","IL","100px","#FF6600","White","Ordina per la foto","CENTER",null,null,null,null,null,"100","75"],
					   ["ID","id","N","30px","#FF6600","White","Ordina per l\\\' ID","RIGHT"],
		    		   ["Modello","description","S","180px","#FF6600","White","Ordina per il modello"],
					   ["Cilindrata cc","displacement","S","70px","#FF6600","White","Ordina per la cilindrata","CENTER"],
					   ["Immatricolazione","registration_string","S","140px","#FF6600","White","Ordina per la data di immatricolazione","RIGHT"],
					   ["Km","km_string","S","90px","#FF6600","White","Ordina per i km percorsi","CENTER"],
					   ["Potenza KW","power","N","80px","#FF6600","White","Ordina per la potenza in cavalli","CENTER"],
					   ["Alimentazione","fuel","S","120px","#FF6600","White","Ordina per il tipo di alimentazione","CENTER"],
					   ["Prezzo","price_string","S","70px","#FF6600","White","Ordina per il prezzo","RIGHT"]];
var enArrayGridCars=CopyArray(itArrayGridCars);
enArrayGridCars[0][0]="Photo";
enArrayGridCars[0][6]="Order by photo";
enArrayGridCars[1][6]="Order by ID";
enArrayGridCars[2][0]="Model";
enArrayGridCars[2][6]="Order by model";
enArrayGridCars[3][0]="Displacement cc";
enArrayGridCars[3][6]="Order by displacement";
enArrayGridCars[4][0]="Registration";
enArrayGridCars[4][6]="Order by registration date";
enArrayGridCars[5][0]="Miles";
enArrayGridCars[5][6]="Order by covered km";
enArrayGridCars[6][0]="Power KW";
enArrayGridCars[6][6]="Order by cc. power";
enArrayGridCars[7][0]="Fuel";
enArrayGridCars[7][6]="Order by the kind of fuel";
enArrayGridCars[8][0]="Price";
enArrayGridCars[8][6]="Order by price";

function Cars_init() {
	params=new Object();
	...
	params.ArrayGrid=itArrayGridCars;
	...
	Cars=new Grid(params);
}
...
Cars_init();

Cars.ChangeLanguage("en");