mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 05:16:06 +03:00
In-code comments and add data for linked validators example
This commit is contained in:
parent
46e0758cbb
commit
0d07a35fe5
@ -61,6 +61,7 @@ function transpose($value) {
|
||||
$continentColumn = 'D';
|
||||
$column = 'F';
|
||||
|
||||
// Set data for dropdowns
|
||||
foreach(glob('./data/continents/*') as $key => $filename) {
|
||||
$continent = pathinfo($filename, PATHINFO_FILENAME);
|
||||
echo "Loading $continent", EOL;
|
||||
@ -87,6 +88,8 @@ foreach(glob('./data/continents/*') as $key => $filename) {
|
||||
|
||||
++$column;
|
||||
}
|
||||
|
||||
// Hide the dropdown data
|
||||
$objPHPExcel->getActiveSheet()
|
||||
->getColumnDimension($continentColumn)
|
||||
->setVisible(false);
|
||||
@ -99,6 +102,7 @@ $objPHPExcel->addNamedRange(
|
||||
);
|
||||
|
||||
|
||||
// Set selection cells
|
||||
$objPHPExcel->getActiveSheet()
|
||||
->setCellValue('A1', 'Continent:');
|
||||
$objPHPExcel->getActiveSheet()
|
||||
@ -111,6 +115,7 @@ $objPHPExcel->getActiveSheet()
|
||||
->getStyle('A1:A3')
|
||||
->getFont()->setBold(true);
|
||||
|
||||
// Set linked validators
|
||||
$objValidation = $objPHPExcel->getActiveSheet()
|
||||
->getCell('B1')
|
||||
->getDataValidation();
|
||||
|
54
Examples/data/continents/Africa.txt
Normal file
54
Examples/data/continents/Africa.txt
Normal file
@ -0,0 +1,54 @@
|
||||
Algeria
|
||||
Angola
|
||||
Benin
|
||||
Botswana
|
||||
Burkina
|
||||
Burundi
|
||||
Cameroon
|
||||
Cape Verde
|
||||
Central African Republic
|
||||
Chad
|
||||
Comoros
|
||||
Congo
|
||||
Congo, Democratic Republic of
|
||||
Djibouti
|
||||
Egypt
|
||||
Equatorial Guinea
|
||||
Eritrea
|
||||
Ethiopia
|
||||
Gabon
|
||||
Gambia
|
||||
Ghana
|
||||
Guinea
|
||||
Guinea-Bissau
|
||||
Ivory Coast
|
||||
Kenya
|
||||
Lesotho
|
||||
Liberia
|
||||
Libya
|
||||
Madagascar
|
||||
Malawi
|
||||
Mali
|
||||
Mauritania
|
||||
Mauritius
|
||||
Morocco
|
||||
Mozambique
|
||||
Namibia
|
||||
Niger
|
||||
Nigeria
|
||||
Rwanda
|
||||
Sao Tome and Principe
|
||||
Senegal
|
||||
Seychelles
|
||||
Sierra Leone
|
||||
Somalia
|
||||
South Africa
|
||||
South Sudan
|
||||
Sudan
|
||||
Swaziland
|
||||
Tanzania
|
||||
Togo
|
||||
Tunisia
|
||||
Uganda
|
||||
Zambia
|
||||
Zimbabwe
|
44
Examples/data/continents/Asia.txt
Normal file
44
Examples/data/continents/Asia.txt
Normal file
@ -0,0 +1,44 @@
|
||||
Afghanistan
|
||||
Bahrain
|
||||
Bangladesh
|
||||
Bhutan
|
||||
Brunei
|
||||
Burma (Myanmar)
|
||||
Cambodia
|
||||
China
|
||||
East Timor
|
||||
India
|
||||
Indonesia
|
||||
Iran
|
||||
Iraq
|
||||
Israel
|
||||
Japan
|
||||
Jordan
|
||||
Kazakhstan
|
||||
Korea, North
|
||||
Korea, South
|
||||
Kuwait
|
||||
Kyrgyzstan
|
||||
Laos
|
||||
Lebanon
|
||||
Malaysia
|
||||
Maldives
|
||||
Mongolia
|
||||
Nepal
|
||||
Oman
|
||||
Pakistan
|
||||
Philippines
|
||||
Qatar
|
||||
Russian Federation
|
||||
Saudi Arabia
|
||||
Singapore
|
||||
Sri Lanka
|
||||
Syria
|
||||
Tajikistan
|
||||
Thailand
|
||||
Turkey
|
||||
Turkmenistan
|
||||
United Arab Emirates
|
||||
Uzbekistan
|
||||
Vietnam
|
||||
Yemen
|
47
Examples/data/continents/Europe.txt
Normal file
47
Examples/data/continents/Europe.txt
Normal file
@ -0,0 +1,47 @@
|
||||
Albania
|
||||
Andorra
|
||||
Armenia
|
||||
Austria
|
||||
Azerbaijan
|
||||
Belarus
|
||||
Belgium
|
||||
Bosnia and Herzegovina
|
||||
Bulgaria
|
||||
Croatia
|
||||
Cyprus
|
||||
Czech Republic
|
||||
Denmark
|
||||
Estonia
|
||||
Finland
|
||||
France
|
||||
Georgia
|
||||
Germany
|
||||
Greece
|
||||
Hungary
|
||||
Iceland
|
||||
Ireland
|
||||
Italy
|
||||
Latvia
|
||||
Liechtenstein
|
||||
Lithuania
|
||||
Luxembourg
|
||||
Macedonia
|
||||
Malta
|
||||
Moldova
|
||||
Monaco
|
||||
Montenegro
|
||||
Netherlands
|
||||
Norway
|
||||
Poland
|
||||
Portugal
|
||||
Romania
|
||||
San Marino
|
||||
Serbia
|
||||
Slovakia
|
||||
Slovenia
|
||||
Spain
|
||||
Sweden
|
||||
Switzerland
|
||||
Ukraine
|
||||
United Kingdom
|
||||
Vatican City
|
23
Examples/data/continents/North America.txt
Normal file
23
Examples/data/continents/North America.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Antigua and Barbuda
|
||||
Bahamas
|
||||
Barbados
|
||||
Belize
|
||||
Canada
|
||||
Costa Rica
|
||||
Cuba
|
||||
Dominica
|
||||
Dominican Republic
|
||||
El Salvador
|
||||
Grenada
|
||||
Guatemala
|
||||
Haiti
|
||||
Honduras
|
||||
Jamaica
|
||||
Mexico
|
||||
Nicaragua
|
||||
Panama
|
||||
Saint Kitts and Nevis
|
||||
Saint Lucia
|
||||
Saint Vincent and the Grenadines
|
||||
Trinidad and Tobago
|
||||
United States
|
14
Examples/data/continents/Oceania.txt
Normal file
14
Examples/data/continents/Oceania.txt
Normal file
@ -0,0 +1,14 @@
|
||||
Australia
|
||||
Fiji
|
||||
Kiribati
|
||||
Marshall Islands
|
||||
Micronesia
|
||||
Nauru
|
||||
New Zealand
|
||||
Palau
|
||||
Papua New Guinea
|
||||
Samoa
|
||||
Solomon Islands
|
||||
Tonga
|
||||
Tuvalu
|
||||
Vanuatu
|
12
Examples/data/continents/South America.txt
Normal file
12
Examples/data/continents/South America.txt
Normal file
@ -0,0 +1,12 @@
|
||||
Argentina
|
||||
Bolivia
|
||||
Brazil
|
||||
Chile
|
||||
Colombia
|
||||
Ecuador
|
||||
Guyana
|
||||
Paraguay
|
||||
Peru
|
||||
Suriname
|
||||
Uruguay
|
||||
Venezuela
|
Loading…
Reference in New Issue
Block a user