From: Matt Brown Date: Fri, 3 Jun 2011 23:12:22 +0000 (+0000) Subject: .net server control is almost feature complete and functional. All .net examples... X-Git-Url: https://git.infodrom.org/?p=infodrom%2Frico3;a=commitdiff_plain;h=95eb9e809d4258904819ecad5fd30f3015c146c4;ds=sidebyside .net server control is almost feature complete and functional. All .net examples have been updated and are working. Added server control source code to svn in new rico3.net branch. Use vb.net express edition 2010 to compile it. git-svn-id: svn://svn.code.sf.net/p/openrico/code/trunk/rico3@84 53df2df2-7ab5-4331-af62-ea79255fa4e2 --- diff --git a/bin/Rico.dll b/bin/Rico.dll index a3dc4ce..4957a27 100644 Binary files a/bin/Rico.dll and b/bin/Rico.dll differ diff --git a/documentation/LiveGrid.html b/documentation/LiveGrid.html index 471a2fb..ccc411f 100644 --- a/documentation/LiveGrid.html +++ b/documentation/LiveGrid.html @@ -723,22 +723,6 @@ See also the filterUI option.
Token in select filters used to indicate "show all values" (default: "___ALL___"). -

Images

-
-
resizeBackground -
Image to use for column resize handle. (default: 'resize.gif') - -
sortAscendImg -
Image to use to indicate that the column is sorted in ascending order. (default: 'sort_asc.gif') - -
sortDescendImg -
Image to use to indicate that the column is sorted in descending order. (default: 'sort_desc.gif') - -
filterImg -
Image used to indicate an active filter on a column. (default: 'filtercol.gif') -
- -

Cookie options

@@ -1005,19 +989,18 @@ use a align="right" on the <th> tag to accomplish the header alignment.
type (DataType in .net plug-in)
A string containing one of these values:
    -
  • text - any tags in the column value are removed before being displayed to the user. -
  • showTags - any tags in the column value are displayed to the user as text. +
  • text (default) - plain text.
  • number - column value is treated as a number, and any number formatting options supplied in the column specification are applied.
  • datetime - column value is treated as a date & time, and any date formatting options supplied in the column specification are applied. -
  • UTCasLocalTime - column/database value is treated as a GMT/UTC date & time, and any date formatting options +
  • utcaslocaltime - column/database value is treated as a GMT/UTC date & time, and any date formatting options supplied in the column specification are applied. Before display, the value is converted to the user's local time zone.
  • date - column value is treated as a date, and any date formatting options supplied in the column specification are applied. -
  • raw (default) - column values are displayed directly to the grid cell. +
  • html - column values are displayed directly to the grid cell. Any HTML markup gets copied into the cell.
@@ -1169,11 +1152,8 @@ to which the filter is applied.
decPlaces
Number of places to the right of the decimal point. (default: 0) -
decPoint -
Decimal point symbol. (default: '.' but overridden in the translation files) -
thouSep -
Symbol for thousands separator. (default: ',' but overridden in the translation files) +
Boolean indicating whether to insert thousands separator. (default: true)
negSign
Specifies how negative numbers should be displayed. Possible values: diff --git a/examples/dotnet/3grids.aspx b/examples/dotnet/3grids.aspx index 73e088f..1f2ab14 100644 --- a/examples/dotnet/3grids.aspx +++ b/examples/dotnet/3grids.aspx @@ -105,12 +105,6 @@ function detailDataMenu(objCell,onBlankRow) { float: left; padding: 5px; } - -div.ricoLG_cell { - font-size: 8pt; - height: 12px; - white-space: nowrap; -} @@ -141,45 +135,51 @@ Double-click on an order to see the line items for that order.
- - - - - - - - - - - + + + + + + + + + + + + +
- - - - - - - - + + + + + + + + + +
- - - - - - - - - - + + + + + + + + + + + +
diff --git a/examples/dotnet/RicoDbViewer.aspx b/examples/dotnet/RicoDbViewer.aspx index 91371be..639eb2d 100644 --- a/examples/dotnet/RicoDbViewer.aspx +++ b/examples/dotnet/RicoDbViewer.aspx @@ -8,8 +8,12 @@ Sub Page_Load(Sender As object, e As EventArgs) Dim restrictions() As String = New String(3) {} if app.OpenDB() then - restrictions(3)="BASE TABLE" - 'restrictions(3)="TABLE" + + select case app.dbDialect + case "Access": restrictions(3)="TABLE" + case else: restrictions(3)="BASE TABLE" + end select + TableList.DataSource = app.dbConnection.GetSchema ("Tables", restrictions) TableList.DataBind() restrictions(3)="VIEW" @@ -65,7 +69,7 @@ html, body {
  • - +
  • @@ -77,7 +81,7 @@ html, body {
  • - +
  • diff --git a/examples/dotnet/RicoDbViewerDetail.aspx b/examples/dotnet/RicoDbViewerDetail.aspx index 4fa5028..68461bb 100644 --- a/examples/dotnet/RicoDbViewerDetail.aspx +++ b/examples/dotnet/RicoDbViewerDetail.aspx @@ -10,33 +10,37 @@ Dim TableName as String Sub Page_Load(Sender As object, e As EventArgs) Dim restrictions() As String = New String(2) {} Dim ColumnInfo As DataTable + Dim ColumnObj + Dim colname as String, colname0 as String, datatype as String - TableName = trim(request.querystring("id")) - if app.OpenGrid(dbViewer) then - + TableName = trim(request.querystring("tabid")) + if app.OpenGrid(dbViewer) AndAlso TableName<>"" then + restrictions(2)=TableName ColumnInfo = app.dbConnection.GetSchema ("Columns", restrictions) - Dim colname as String, colname0 as String, datatype as String + dbViewer.Tables.Add(new Rico.Table("[" & TableName & "]")) + dbViewer.requestParameters.Add("tabid",TableName) ' need to get the table name back so we can define columns every during every AJAX call + For Each colinfo As DataRow In ColumnInfo.Rows colname=colinfo("COLUMN_NAME").ToString datatype=colinfo("DATA_TYPE").ToString if IsNothing(colname0) then colname0=colname if IsNumeric(datatype) then datatype=ADOColType(datatype) - Dim ColumnObj as New Rico.Column() if InStr(1,datatype,"binary",1) > 0 or left(datatype,3)="???" or datatype="image" then + ColumnObj = New Rico.FormulaCol() ColumnObj.Formula = "'?'" else + ColumnObj = New Rico.TableCol() ColumnObj.ColName = colname end if ColumnObj.Heading=colname ColumnObj.width=100 - if InStr(1,datatype,"DATETIME",1) > 0 then ColumnObj.DataType="datetime" + if InStr(1,datatype,"DATETIME",1) > 0 then ColumnObj.DataType=Rico.Column.DataTypeValues.date dbViewer.AddColumn(ColumnObj) Next dbViewer.DefaultSort = colname0 - dbViewer.TableName = "[" & TableName & "]" end if End Sub diff --git a/examples/dotnet/ShipperEdit.aspx b/examples/dotnet/ShipperEdit.aspx index 63f2a6b..80ddee8 100644 --- a/examples/dotnet/ShipperEdit.aspx +++ b/examples/dotnet/ShipperEdit.aspx @@ -3,12 +3,11 @@ <%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %> - @@ -21,11 +20,6 @@ End Sub - @@ -41,10 +35,11 @@ Updates are disabled on the database, so you will get an error message if you tr

    Shippers Table

    - - - - + + + + + diff --git a/examples/dotnet/employees.aspx b/examples/dotnet/employees.aspx index 91bac32..9b67dca 100644 --- a/examples/dotnet/employees.aspx +++ b/examples/dotnet/employees.aspx @@ -24,12 +24,9 @@ End Sub - + +
    @@ -46,23 +43,24 @@ Updates are disabled on the database, so you will get an error message if you tr

    Employees Table

    - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/examples/dotnet/ex1.aspx b/examples/dotnet/ex1.aspx index 7556633..e169b98 100644 --- a/examples/dotnet/ex1.aspx +++ b/examples/dotnet/ex1.aspx @@ -9,22 +9,6 @@ - - @@ -44,246 +28,249 @@ Department of Economic and Social Affairs of the United Nations Secretariat World Population Prospects: The 2008 Revision. Highlights. New York: United Nations.

    -

     

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Population (thousands)
    Country or area 1950 2009 2015 2025 2050
    Afghanistan 8151 28150 34246 44970 73938
    Albania 1215 3155 3256 3395 3303
    Algeria 8753 34895 38088 42882 49610
    American Samoa 19 67 74 86 107
    Andorra 6 86 93 107 137
    Angola 4148 18498 21690 27441 42267
    Anguilla 5 15 17 18 20
    Antigua and Barbuda 46 88 93 101 112
    Argentina 17150 40276 42548 45883 50943
    Armenia 1354 3083 3139 3181 3018
    Aruba 38 107 109 112 106
    Australia 8219 21293 22607 24703 28724
    Austria 6936 8364 8467 8600 8515
    Azerbaijan 2896 8832 9426 10128 10579
    Bahamas 79 342 366 402 455
    Bahrain 116 791 882 1021 1277
    Bangladesh 43595 162221 175217 195012 222495
    Barbados 211 256 260 262 237
    Belarus 7745 9634 9355 8851 7275
    Belgium 8628 10647 10878 11191 11493
    Belize 69 307 344 404 506
    Benin 2050 8935 10647 13767 21982
    Bermuda 37 65 65 66 63
    Bhutan 168 697 770 865 1013
    Bolivia 2714 9863 10854 12368 14908
    Bosnia and Herzegovina 2661 3767 3727 3608 3008
    Botswana 413 1950 2106 2337 2758
    Brazil 53975 193734 202866 213802 218512
    British Virgin Islands 7 23 24 26 28
    Brunei Darussalam 48 400 443 513 658
    Bulgaria 7251 7545 7263 6752 5392
    Burkina Faso 4080 15757 19013 24837 40830
    Burundi 2456 8303 9413 11161 14846
    Cambodia 4346 14805 16357 18973 23795
    Cameroon 4466 19522 22169 26478 36736
    Canada 13737 33573 35493 38659 44414
    Cape Verde 146 506 548 616 703
    Cayman Islands 7 56 59 63 66
    Central African Republic 1327 4422 4927 5747 7603
    Chad 2429 11206 13120 16906 27776
    Channel Islands 102 150 151 152 144
    Chile 6082 16970 17926 19266 20657
    China 544951 1345751 1395998 1453140 1417045
    China, Hong Kong SAR 1974 7022 7398 7969 8623
    China, Macao SAR 190 538 568 603 593
    Colombia 12000 45660 49385 54920 62877
    Comoros 156 676 767 907 1226
    Congo 808 3683 4225 5094 6863
    Cook Islands 15 20 20 21 24
    Costa Rica 966 4579 4957 5521 6373
    Côte d'Ivoire 2505 21075 24210 29738 43373
    Croatia 3850 4416 4370 4254 3825
    Cuba 5920 11204 11213 11148 9725
    Cyprus 494 871 925 1014 1175
    Czech Republic 8925 10369 10510 10573 10294
    Dem. People's Rep. of Korea 9737 23906 24399 25128 24562
    Dem. Republic of the Congo 12184 66020 77419 98123 147512
    Denmark 4271 5470 5523 5590 5551
    Djibouti 62 864 953 1111 1469
    Dominica 51 67 67 68 66
    Dominican Republic 2427 10090 10867 11973 13441
    Ecuador 3387 13625 14596 16074 17989
    Egypt 21514 82999 91778 104970 129533
    El Salvador 2200 6163 6383 6895 7882
    Equatorial Guinea 226 676 781 971 1445
    Eritrea 1141 5073 6009 7404 10787
    Estonia 1101 1340 1337 1321 1233
    Ethiopia 18434 82825 96237 119822 173811
    Faeroe Islands 32 50 52 55 58
    Falkland Islands (Malvinas) 2 3 3 3 3
    Fiji 289 849 874 905 910
    Finland 4009 5326 5432 5533 5445
    France 41832 62343 63900 65769 67668
    French Guiana 25 226 261 323 462
    French Polynesia 61 269 289 318 354
    Gabon 469 1475 1639 1915 2471
    Gambia 258 1705 1985 2478 3763
    Georgia 3527 4260 4084 3888 3267
    Germany 68376 82167 81346 79258 70504
    Ghana 4981 23837 26925 32233 45213
    Gibraltar 20 31 31 32 30
    Greece 7566 11161 11261 11274 10939
    Greenland 23 57 57 56 50
    Grenada 77 104 107 109 97
    Guadeloupe 210 465 476 489 477
    Guam 60 178 191 211 242
    Guatemala 3146 14027 16227 19927 27480
    Guinea 2619 10069 11844 15158 23975
    Guinea-Bissau 518 1611 1848 2296 3555
    Guyana 423 762 754 732 558
    Haiti 3221 10033 10957 12476 15485
    Holy See 1 1 1 1 1
    Honduras 1487 7466 8386 9844 12402
    Hungary 9338 9993 9874 9647 8934
    Iceland 143 323 353 384 407
    India 371857 1198003 1294192 1431272 1613800
    Indonesia 77152 229965 244191 263287 288110
    Iran (Islamic Republic of) 16913 74196 79454 87134 96975
    Iraq 5719 30747 35884 44692 63995
    Ireland 2969 4515 4886 5370 6295
    Isle of Man 55 80 81 80 75
    Israel 1258 7170 7823 8769 10649
    Italy 46367 59870 60604 60018 57066
    Jamaica 1403 2719 2786 2866 2683
    Japan 82824 127156 125791 120793 101659
    Jordan 472 6316 6957 8088 10241
    Kazakhstan 6703 15637 16289 17025 17848
    Kenya 6077 39802 46433 57573 85410
    Kiribati 26 98 107 123 151
    Kuwait 152 2985 3378 3988 5240
    Kyrgyzstan 1740 5482 5877 6378 6882
    Lao People's Dem. Republic 1666 6320 7028 8273 10744
    Latvia 1949 2249 2197 2101 1854
    Lebanon 1443 4224 4426 4736 5033
    Lesotho 734 2067 2168 2306 2491
    Liberia 824 3955 4665 5858 8841
    Libyan Arab Jamahiriya 1029 6420 7158 8144 9819
    Liechtenstein 14 36 38 40 45
    Lithuania 2567 3287 3143 2985 2579
    Luxembourg 296 486 520 582 733
    Madagascar 4084 19625 22853 28595 42693
    Malawi 2881 15263 17998 23194 36575
    Malaysia 6110 27468 30041 33770 39664
    Maldives 82 309 338 384 455
    Mali 4268 13010 14993 18603 28260
    Malta 312 409 417 426 413
    Marshall Islands 13 62 70 79 92
    Martinique 222 405 411 418 393
    Mauritania 651 3291 3732 4443 6061
    Mauritius 493 1288 1337 1400 1426
    Mayotte 15 194 224 277 386
    Mexico 27741 109610 115528 123366 128964
    Micronesia (Fed. States of) 32 111 114 122 128
    Moldova (Republic of) 2341 3604 3462 3291 2734
    Monaco 20 33 33 35 38
    Mongolia 761 2671 2855 3134 3446
    Montenegro 399 624 627 633 618
    Montserrat 14 6 6 7 7
    Morocco 8953 31993 34330 37865 42583
    Mozambique 6442 22894 25957 31190 44148
    Myanmar 17158 50020 53087 57585 63373
    Namibia 485 2171 2412 2810 3588
    Nauru 3 10 11 11 11
    Nepal 8126 29331 32503 38031 49028
    Netherlands 10114 16592 16915 17348 17399
    Netherlands Antilles 112 198 207 210 192
    New Caledonia 65 250 271 304 362
    New Zealand 1908 4266 4492 4831 5349
    Nicaragua 1295 5743 6265 7058 8143
    Niger 2462 15290 19150 27388 58216
    Nigeria 36680 154729 175928 210057 289083
    Niue 5 1 1 1 1
    Northern Mariana Islands 7 87 96 111 151
    Norway 3265 4812 5036 5365 5947
    Occupied Palestinian Territory 1005 4277 5090 6553 10265
    Oman 456 2845 3198 3782 4878
    Pakistan 41177 180808 205504 246286 335195
    Palau 7 20 21 23 26
    Panama 860 3454 3773 4267 5092
    Papua New Guinea 1798 6732 7678 9265 12871
    Paraguay 1473 6349 7007 8026 9867
    Peru 7632 29165 31197 34528 39776
    Philippines 19996 91983 101734 117270 146156
    Pitcairn 0 0 0 0 0
    Poland 24824 38074 37788 36964 32013
    Portugal 8405 10707 10787 10706 10015
    Puerto Rico 2218 3982 4074 4176 4103
    Qatar 25 1409 1630 1848 2316
    Republic of Korea 19211 48333 49153 49484 44077
    Réunion 248 827 886 973 1096
    Romania 16311 21275 20787 19961 17279
    Russian Federation 102702 140874 137983 132345 116097
    Rwanda 2162 9998 11743 14676 22082
    Saint Helena 5 4 4 5 5
    Saint Kitts and Nevis 46 52 56 61 69
    Saint Lucia 83 172 182 198 217
    Saint Pierre and Miquelon 5 6 6 6 6
    St. Vincent and the Grenadines 67 109 110 111 119
    Samoa 82 179 181 188 192
    San Marino 13 31 32 33 33
    Sao Tome and Principe 60 163 180 216 296
    Saudi Arabia 3201 25721 28933 34176 43658
    Senegal 2416 12534 14526 17861 26102
    Serbia 6732 9850 9828 9720 9193
    Seychelles 36 84 86 91 97
    Sierra Leone 1944 5696 6557 8112 12446
    Singapore 1022 4737 5059 5362 5221
    Slovakia 3463 5406 5437 5413 4917
    Slovenia 1473 2020 2044 2050 1954
    Solomon Islands 90 523 599 725 1007
    Somalia 2264 9133 10731 13922 23522
    South Africa 13683 50110 51684 53766 56802
    Spain 28009 44904 47203 49265 51260
    Sri Lanka 8241 20238 21167 22033 21705
    Sudan 9190 42272 47730 56688 75884
    Suriname 215 520 547 586 619
    Swaziland 273 1185 1287 1455 1749
    Sweden 7014 9249 9498 9915 10571
    Switzerland 4693 7568 7736 8020 8514
    Syrian Arab Republic 3536 21906 24494 28592 36911
    Tajikistan 1532 6952 7761 9075 11111
    TFYR Macedonia 1230 2042 2045 2037 1857
    Thailand 20607 67764 69939 72628 73361
    Timor-Leste 433 1134 1385 1869 3217
    Togo 1329 6619 7607 9282 13196
    Tokelau 2 1 1 1 1
    Tonga 47 104 105 112 123
    Trinidad and Tobago 636 1339 1368 1388 1278
    Tunisia 3530 10272 10884 11797 12711
    Turkey 21484 74816 79966 87364 97389
    Turkmenistan 1211 5110 5509 6072 6796
    Turks and Caicos Islands 5 33 35 38 40
    Tuvalu 5 10 10 11 11
    Uganda 5158 32710 39710 53406 91271
    Ukraine 37298 45708 44165 41617 35026
    United Arab Emirates 70 4599 5193 6109 8253
    United Kingdom 50616 61565 63528 66601 72365
    United Republic of Tanzania 7650 43739 52109 67394 109450
    United States of America 157813 314659 332334 358735 403932
    United States Virgin Islands 27 110 108 103 75
    Uruguay 2239 3361 3430 3546 3637
    Uzbekistan 6314 27488 29456 32715 36439
    Vanuatu 48 240 276 338 482
    Venezuela (Bolivarian Republic of) 5094 28583 31292 35370 42042
    Viet Nam 27367 88069 93647 102054 111666
    Wallis and Futuna Islands 7 15 16 17 17
    Western Sahara 14 513 625 775 938
    Yemen 4316 23580 27819 35509 53689
    Zambia 2340 12935 14980 18890 28957
    Zimbabwe 2747 12523 14029 16780 22178
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/dotnet/ex2editfilter.aspx b/examples/dotnet/ex2editfilter.aspx index 08097e1..d89ae67 100644 --- a/examples/dotnet/ex2editfilter.aspx +++ b/examples/dotnet/ex2editfilter.aspx @@ -24,11 +24,6 @@ End Sub - @@ -46,24 +41,26 @@ Updates are disabled on the database, so you will get an error message if you tr

    Orders Table

    - + + + - - - - - - + + + + + + - - - - - - + + + + + + diff --git a/examples/dotnet/ex2json.aspx b/examples/dotnet/ex2json.aspx index 7845f92..3ccf52b 100644 --- a/examples/dotnet/ex2json.aspx +++ b/examples/dotnet/ex2json.aspx @@ -21,11 +21,6 @@ End Sub - @@ -44,16 +39,15 @@ Click on a cell to see available actions. (displays directly in Chrome and Safari, requires JSONview or similar extension in Firefox). - - - - - - - - - - + + + + + + + + + diff --git a/examples/dotnet/ex2nosession.aspx b/examples/dotnet/ex2nosession.aspx index c24d389..36e4444 100644 --- a/examples/dotnet/ex2nosession.aspx +++ b/examples/dotnet/ex2nosession.aspx @@ -10,7 +10,7 @@ Sub Page_Load(Sender As object, e As EventArgs) dim arEmpSql as string() = {"LastName","', '","FirstName"} dim oSqlCompat=new sqlCompatibilty(app.dbDialect) EmployeeID.SelectSql="select EmployeeID," & oSqlCompat.Concat(arEmpSql,false) & " from employees order by LastName,FirstName" - app.OpenGridForm(ex8n) + app.OpenGridForm(nosession) End Sub @@ -38,30 +38,34 @@ Base Library: @@ -50,6 +50,8 @@ ul li {
  • LiveGrid sourced from HTML table
  • LiveGrid sourced from SQL database (xml)
  • LiveGrid sourced from SQL database (json) +
  • LiveGrid with custom column styles +
  • LiveGrid with completely custom style
  • 3 grids with drill-down
  • Editable LiveGrid (Shippers)
  • Editable LiveGrid (Employees) diff --git a/examples/dotnet/photos.aspx b/examples/dotnet/photos.aspx index 422bb20..1ac0149 100644 --- a/examples/dotnet/photos.aspx +++ b/examples/dotnet/photos.aspx @@ -12,14 +12,14 @@ @@ -66,20 +65,19 @@ function UpdateGrid() {
    -

    Find 100 Flickr photos tagged with the keywords you type below (separate words with commas): +Base Library: +


    Find 100 Flickr photos tagged with the keywords you type below (separate words with commas):

    Then try moving your cursor over each photo...

    - - + - diff --git a/examples/dotnet/simplegrid.aspx b/examples/dotnet/simplegrid.aspx index a00cafa..a9ddee3 100644 --- a/examples/dotnet/simplegrid.aspx +++ b/examples/dotnet/simplegrid.aspx @@ -74,10 +74,14 @@ sub AddRow(ProductName as String, Gross as Double, Discounts as Double) ex1.AddDataRow() ex1.AddCell(ProductName) ex1.AddCell("$" & FormatNumber(Gross,0,-1,0,-1)) + ex1.SetCellAttr("class","number") ex1.AddCell("$" & FormatNumber(Discounts,0,-1,0,-1)) + ex1.SetCellAttr("class","number") ex1.AddCell("$" & FormatNumber(Gross-Discounts,0,-1,0,-1)) + ex1.SetCellAttr("class","number") pct=Discounts/Gross ex1.AddCell(pct.toString("0%")) + ex1.SetCellAttr("class","number") end sub Protected Overrides Sub Render(writer as HTMLTextWriter) @@ -132,6 +136,9 @@ function ExportGridServer(ExportType) { div.ricoLG_cell { white-space:nowrap; } +.number { + text-align: right; +} @@ -161,13 +168,11 @@ can be formatted individually. - - - - - - + + + + diff --git a/examples/php/photos.php b/examples/php/photos.php index b142113..c4071e1 100644 --- a/examples/php/photos.php +++ b/examples/php/photos.php @@ -31,7 +31,7 @@ Rico.onLoad( function() { Rico.eventBind(imgctl._img[i],'mouseover',Rico.eventHandle(window,'img_mouseover')); Rico.eventBind(imgctl._img[i],'mouseout',Rico.eventHandle(window,'img_mouseout')); } - img_popup=document.getElementById('img_popup'); + img_popup=Rico.$('img_popup'); }); function img_mouseover(e) { @@ -58,7 +58,7 @@ function img_mouseout(e) { } function UpdateGrid() { - var tags=document.getElementById('tags').value; + var tags=Rico.$('tags').value; if (tags) { photoGrid.resetContents(false); photoBuffer.fetchData=true; // force another XML fetch diff --git a/minsrc/ricoGridCommon.js b/minsrc/ricoGridCommon.js index 2ec1975..c640932 100644 --- a/minsrc/ricoGridCommon.js +++ b/minsrc/ricoGridCommon.js @@ -42,7 +42,6 @@ Rico.GridCommon = { FilterAllToken : '___ALL___', // select box value to use to indicate ALL columnSpecs : [] }; - this.colWidths = []; this.hdrCells=[]; this.headerColCnt=0; this.headerRowIdx=0; // row in header which gets resizers (no colspan's in this row) @@ -715,12 +714,7 @@ Rico.ColumnConst = { SORT_ASC: "ASC", SORT_DESC: "DESC", - MINWIDTH: 10, - DOLLAR: {type:'number', prefix:'$', decPlaces:2, ClassName:'alignright'}, - EURO: {type:'number', prefix:'€', decPlaces:2, ClassName:'alignright'}, - PERCENT: {type:'number', suffix:'%', decPlaces:2, multiplier:100, ClassName:'alignright'}, - QTY: {type:'number', decPlaces:0, ClassName:'alignright'}, - DEFAULT: {type:"showTags"} + MINWIDTH: 10 } @@ -758,18 +752,9 @@ Rico.TableColumnBase.prototype = { this.mouseOutHandler = Rico.eventHandle(this,'handleMouseOut'); this.fieldName = 'col'+this.index; + this.format={type:"text"}; var spec = liveGrid.options.columnSpecs[colIdx]; - this.format=Rico.extend( {}, Rico.ColumnConst.DEFAULT); - switch (typeof spec) { - case 'object': - if (typeof spec.format=='string') Rico.extend(this.format, Rico.ColumnConst[spec.format.toUpperCase()]); - Rico.extend(this.format, spec); - break; - case 'string': - if (spec.slice(0,4)=='spec') spec=spec.slice(4).toUpperCase(); // for backwards compatibility - if (typeof Rico.ColumnConst[spec]=='object') Rico.extend(this.format, Rico.ColumnConst[spec]); - break; - } + if (typeof spec == 'object') Rico.extend(this.format, spec); Rico.addClass(this.dataColDiv, this.colClassName()); this.visible=true; if (typeof this.format.visible=='boolean') this.visible=this.format.visible; @@ -824,15 +809,7 @@ Rico.TableColumnBase.prototype = { clearCell: function(rowIndex) { var gridCell=this.cell(rowIndex); this._clear(gridCell,rowIndex); - if (!this.liveGrid.buffer) return; - var acceptAttr=this.liveGrid.buffer.options.acceptAttr; - for (var k=0; k 0; c++) { - if (cells[0].className=='ricoFrozen') { + if (Rico.hasClass(cells[0],'ricoFrozen')) { if (r==this.headerRowIdx) this.options.frozenColumns=c+1; } else { h=1; @@ -1994,9 +1975,9 @@ initialize: function(liveGrid,colIdx,hdrInfo,tabIdx) { Rico.extend(this, new Rico.TableColumnBase()); this.baseInit(liveGrid,colIdx,hdrInfo,tabIdx); this.buffer=liveGrid.buffer; - if (typeof(this.format.type)!='string' || this.format.EntryType=='tinyMCE') this.format.type='raw'; + if (typeof(this.format.type)!='string' || this.format.EntryType=='tinyMCE') this.format.type='html'; if (typeof this.isNullable!='boolean') this.isNullable = /number|date/.test(this.format.type); - this.isText = /raw|text|showTags/.test(this.format.type); + this.isText = /html|text/.test(this.format.type); Rico.log(" sortable="+this.sortable+" filterable="+this.filterable+" hideable="+this.hideable+" isNullable="+this.isNullable+' isText='+this.isText); this.fixHeaders(this.liveGrid.tableId, this.options.hdrIconsFirst); if (this['format_'+this.format.type]) { @@ -2288,13 +2269,6 @@ mFilterOtherClick: function(e) { }, format_text: function(v) { - if (typeof v!='string') - return ' '; - else - return Rico.stripTags(v); -}, - -format_showTags: function(v) { if (typeof v!='string') return ' '; else @@ -2319,7 +2293,7 @@ format_datetime: function(v) { }, // converts GMT/UTC to local time -format_UTCasLocalTime: function(v) { +format_utcaslocaltime: function(v) { if (typeof v=='undefined' || v=='' || v==null) return ' '; else { @@ -2382,8 +2356,8 @@ getValue: function(windowRow) { return this.buffer.getWindowCell(windowRow,this.index); }, -getBufferAttr: function(windowRow) { - return this.buffer.getWindowAttr(windowRow,this.index); +getBufferStyle: function(windowRow) { + return this.buffer.getWindowStyle(windowRow,this.index); }, setValue: function(windowRow,newval) { @@ -2414,17 +2388,8 @@ displayValue: function(windowRow) { } var gridCell=this.cell(windowRow); this._display(bufval,gridCell,windowRow); - var acceptAttr=this.buffer.options.acceptAttr; - if (acceptAttr.length==0) return; - var bufAttr=this.getBufferAttr(windowRow); - if (bufAttr==null) return; - for (var k=0; k 0) { - this.filtermenu.addMenuItemId("gridmenuRefresh", function() { livegrid.filterHandler(); }, true); this.filtermenu.addMenuItemId("gridmenuRemoveAll", function() { livegrid.clearFilters(); }, true); } - } else if (livegrid.filterCount() > 0) { - this.addSubMenuItem(Rico.getPhraseById("gridmenuFilterBy",column.displayName), this.filtermenu, false); - this.filtermenu.addMenuItemId("gridmenuRemoveAll", function() { livegrid.clearFilters(); }, true); + this.filtermenu.addMenuItemId("gridmenuRefresh", function() { livegrid.filterHandler(); }, true); } // menu items for Print/Export this.exportmenu.clearMenu(); - if (buffer.printVisibleSQL && typeof(buffer.dataSource)=='string') { - // SQL buffer - this.addSubMenuItem(Rico.getPhraseById('gridmenuExport'),this.exportmenu,false); - this.exportmenu.addMenuItemId("gridmenuExportVis2Web", function() { buffer.printVisibleSQL('html'); }); - this.exportmenu.addMenuItemId("gridmenuExportAll2Web", function() { buffer.printAllSQL('html'); }, buffer.totalRows <= maxprint); - this.exportmenu.addMenuBreak(); - this.exportmenu.addMenuItemId("gridmenuExportVis2SS", function() { buffer.printVisibleSQL('xl'); }); - this.exportmenu.addMenuItemId("gridmenuExportAll2SS", function() { buffer.printAllSQL('xl'); }, buffer.totalRows <= maxprint); - } else if (maxprint > 0 && totrows>0) { - // any other buffer + if (maxprint > 0) { this.addSubMenuItem(Rico.getPhraseById('gridmenuExport'),this.exportmenu,false); - this.exportmenu.addMenuItemId("gridmenuExportVis2Web", function() { buffer.printVisible(); }); - this.exportmenu.addMenuItemId("gridmenuExportAll2Web", function() { buffer.printAll(); }, buffer.totalRows <= maxprint); + if (buffer.printVisibleSQL && typeof(buffer.dataSource)=='string') { + // SQL buffer + this.exportmenu.addMenuItemId("gridmenuExportVis2Web", function() { buffer.printVisibleSQL('html'); }); + this.exportmenu.addMenuItemId("gridmenuExportAll2Web", function() { buffer.printAllSQL('html'); }, buffer.totalRows <= maxprint); + this.exportmenu.addMenuBreak(); + this.exportmenu.addMenuItemId("gridmenuExportVis2SS", function() { buffer.printVisibleSQL('xl'); }); + this.exportmenu.addMenuItemId("gridmenuExportAll2SS", function() { buffer.printAllSQL('xl'); }, buffer.totalRows <= maxprint); + } else { + // any other buffer + this.addSubMenuItem(Rico.getPhraseById('gridmenuExport'),this.exportmenu,false); + this.exportmenu.addMenuItemId("gridmenuExportVis2Web", function() { buffer.printVisible(); }); + this.exportmenu.addMenuItemId("gridmenuExportAll2Web", function() { buffer.printAll(); }, buffer.totalRows <= maxprint); + } } // menu items for hide/unhide diff --git a/minsrc/ricoSimpleGrid.js b/minsrc/ricoSimpleGrid.js index dc6a050..bcb94c2 100644 --- a/minsrc/ricoSimpleGrid.js +++ b/minsrc/ricoSimpleGrid.js @@ -47,11 +47,6 @@ Rico.SimpleGrid.prototype = { if (!this.tabs[i]) return; this.hdrTabs[i]=document.getElementById(this.tableId+'_tab'+i+'h'); if (!this.hdrTabs[i]) return; - //if (i==0) this.tabs[i].style.position='absolute'; - //if (i==0) this.tabs[i].style.left='0px'; - //this.hdrTabs[i].style.position='absolute'; - //this.hdrTabs[i].style.top='0px'; - //this.hdrTabs[i].style.zIndex=1; this.thead[i]=this.hdrTabs[i]; this.tbody[i]=this.tabs[i]; this.headerColCnt = this.getColumnInfo(this.hdrTabs[i].rows); @@ -63,10 +58,6 @@ Rico.SimpleGrid.prototype = { alert('ERROR: no columns found in "'+this.tableId+'"'); return; } - //this.hdrHt=Math.max(Rico.nan2zero(this.hdrTabs[0].offsetHeight),this.hdrTabs[1].offsetHeight); - //for (i=0; i<2; i++) { - // if (i==0) this.tabs[i].style.top=this.hdrHt+'px'; - //} this.createColumnArray('SimpleGridColumn'); this.pageSize=this.columns[0].dataColDiv.childNodes.length; this.sizeDivs(); diff --git a/ricoClient/css/coffee-with-milk.css b/ricoClient/css/coffee-with-milk.css index 4dda072..e4004a9 100644 --- a/ricoClient/css/coffee-with-milk.css +++ b/ricoClient/css/coffee-with-milk.css @@ -12,7 +12,7 @@ div.ricoLG_outerDiv div.ricoLG_cell, div.ricoLG_outerDiv div.ricoLG_cell *, div. color:#000; } -.ricoLG_top { +table.ricoLG_table { border-top:1px solid #523A0B !important; } diff --git a/ricoClient/css/grayedout.css b/ricoClient/css/grayedout.css index 277fc23..6632025 100644 --- a/ricoClient/css/grayedout.css +++ b/ricoClient/css/grayedout.css @@ -16,7 +16,7 @@ tr.ricoLG_hdg th, tr.ricoLG_hdg td, table.ricoLiveGrid thead td, table.ricoLiveG background-color: #FFF !important; } -.ricoLG_bottom div.ricoLG_cell, table.ricoLG_top, table.ricoLG_top thead th, table.ricoLG_top thead td, table.ricoLiveGrid td, table.ricoLiveGrid th, .ricoLG_bottom th, .ricoLG_bottom td { +.ricoLG_bottom div.ricoLG_cell, table.ricoLG_table, thead.ricoLG_top th, thead.ricoLG_top td, table.ricoLiveGrid td, table.ricoLiveGrid th, .ricoLG_bottom th, .ricoLG_bottom td { border-color: #CCC !important; } diff --git a/ricoClient/css/rico.css b/ricoClient/css/rico.css index 897eb83..97a7443 100644 --- a/ricoClient/css/rico.css +++ b/ricoClient/css/rico.css @@ -44,7 +44,7 @@ div.ricoLG_highlightDiv { border: 2px solid black; } -.ricoLG_table, table.ricoLiveGrid { +.ricoLG_table, .ricoLG_scrollTab, table.ricoLiveGrid { margin: 0px; padding: 0px; border-right: 1px solid silver; @@ -96,11 +96,11 @@ div.ricoLG_col { width:100px; } -table.ricoLG_top thead div.ricoLG_col { +thead.ricoLG_top div.ricoLG_col { position:relative; } -table.ricoLG_top thead div.ricoLG_Resize { +thead.ricoLG_top div.ricoLG_Resize { position:absolute; width:5px; height:100%; @@ -114,17 +114,17 @@ table.ricoLG_top thead div.ricoLG_Resize { border-width: 0px 0px 1px 0px; } -table.ricoLG_top, table.ricoLiveGrid { +table.ricoLG_table, table.ricoLiveGrid { border-top: 1px solid silver; } -table.ricoLG_top thead th, table.ricoLG_top thead td, table.ricoLiveGrid td, table.ricoLiveGrid th { +thead.ricoLG_top th, thead.ricoLG_top td, table.ricoLiveGrid td, table.ricoLiveGrid th { border-style: solid; border-color: silver; border-width: 0px 0px 1px 1px; } -* html table.ricoLG_top thead th, * html table.ricoLG_top thead td, * html table.ricoLiveGrid td, * html table.ricoLiveGrid th { +* html thead.ricoLG_top th, * html thead.ricoLG_top td, * html table.ricoLiveGrid td, * html table.ricoLiveGrid th { position: relative; /* IE6 only */ } @@ -144,11 +144,12 @@ div.ricoLG_cell, table.ricoLiveGrid td, table.ricoLiveGrid th { padding-bottom:3px; } -div.ricoLG_messageDiv { +.ricoLG_messageDiv { font-weight:bold; font-size:larger; text-align:center; padding:1em; + background-color: #EEE; opacity:0.8; } @@ -167,24 +168,12 @@ span.ricoCaption { font-weight: bold; } -div.alignleft { - text-align: left; -} - -div.aligncenter { - text-align: center; -} - -div.alignright { - text-align: right; -} - span.ricoSessionTimer { background-color:black; color:white; } -table.ricoLG_top thead option, table.ricoLG_top thead select, table.ricoLG_top thead input { +thead.ricoLG_top option, thead.ricoLG_top select, thead.ricoLG_top input { font-weight: normal; font-size: 8pt !important; padding: 1px; diff --git a/ricoClient/css/seaglass.css b/ricoClient/css/seaglass.css index 4a6763f..a3ea9a4 100644 --- a/ricoClient/css/seaglass.css +++ b/ricoClient/css/seaglass.css @@ -23,8 +23,8 @@ tr.ricoLG_hdg .ricoLG_cell a:hover { .ricoLG_bottom a, .ricoLG_bottom a:link { color: #325C91; } .ricoLG_bottom a:visited { color: #466C8E; } .ricoLG_bottom a:hover, .ricoLG_bottom a:focus { color: #1E4C94; } -.ricoLG_table { - background: #f1f8ee; +.ricoLG_bottom { + background-color: #f1f8ee; color: #033; } div.ricoLG_messageDiv { diff --git a/ricoClient/js/rico.js b/ricoClient/js/rico.js index 86f6c9d..cb46cba 100644 --- a/ricoClient/js/rico.js +++ b/ricoClient/js/rico.js @@ -19,54 +19,56 @@ var Rico = { Version: '3.0b2', theme: {}, + onLoadCallbacks: [], + windowIsLoaded: false, + preloadMsgs: '', + inputtypes: {search: 0, number: 0, range: 0, color: 0, tel: 0, url: 0, email: 0, date: 0, month: 0, week: 0, time: 0, datetime: 0, 'datetime-local': 0}, init : function() { try { // fix IE background image flicker (credit: www.mister-pixel.com) document.execCommand("BackgroundImageCache", false, true); } catch(err) {} - if (typeof Rico_CONFIG == 'object') { - if (Rico_CONFIG.jsDir) this.setPaths(Rico_CONFIG.jsDir); - this.setBackgroundStyles(); - if (Rico_CONFIG.enableLogging) this.enableLogging(); - } - this.preloadMsgs=''; - this.baseHref= location.protocol + "//" + location.host; - this.windowIsLoaded=false; - this.onLoadCallbacks=[]; + if (typeof Rico_CONFIG == 'object') this.setConfig(Rico_CONFIG); this.onLoad(function() { Rico.log('Pre-load messages:\n'+Rico.preloadMsgs); }); }, + // called by rico2xxx.js _bindLoadEvent : function() { Rico.eventBind(window,"load", Rico.eventHandle(Rico,'windowLoaded')); }, - setPaths : function(jsDir) { - this.jsDir = jsDir; - }, - - setBackgroundStyles: function() { + setConfig : function(ConfigObj) { var el = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(el); if (!window.createPopup) { /* For Safari */ el.appendChild(document.createTextNode('')); } var s = document.styleSheets[document.styleSheets.length - 1]; - this.addCssRule(s,'.rico-icon',Rico_CONFIG.imgIcons,'no-repeat'); - this.addCssRule(s,'.ricoLG_Resize',Rico_CONFIG.imgResize,'repeat'); - if (Rico_CONFIG.imgHeading) { - var repeat='repeat-x scroll left center'; - this.addCssRule(s,'tr.ricoLG_hdg th',Rico_CONFIG.imgHeading,repeat); - this.addCssRule(s,'tr.ricoLG_hdg td',Rico_CONFIG.imgHeading,repeat); - this.addCssRule(s,'table.ricoLiveGrid thead td',Rico_CONFIG.imgHeading,repeat); - this.addCssRule(s,'table.ricoLiveGrid thead th',Rico_CONFIG.imgHeading,repeat); - this.addCssRule(s,'.ricoTitle',Rico_CONFIG.imgHeading,repeat); - this.addCssRule(s,'.Rico_accTitle',Rico_CONFIG.imgHeading,repeat); + this.addCssBackgroundRule(s,'.rico-icon',ConfigObj.imgIcons,'no-repeat'); + this.addCssBackgroundRule(s,'.ricoLG_Resize',ConfigObj.imgResize,'repeat'); + if (ConfigObj.imgHeading) { + var repeat='repeat-x'; + var pos='left center'; + this.addCssBackgroundRule(s,'tr.ricoLG_hdg th',ConfigObj.imgHeading,repeat,pos); + this.addCssBackgroundRule(s,'tr.ricoLG_hdg td',ConfigObj.imgHeading,repeat,pos); + this.addCssBackgroundRule(s,'table.ricoLiveGrid thead td',ConfigObj.imgHeading,repeat,pos); + this.addCssBackgroundRule(s,'table.ricoLiveGrid thead th',ConfigObj.imgHeading,repeat,pos); + this.addCssBackgroundRule(s,'.ricoTitle',ConfigObj.imgHeading,repeat,pos); + this.addCssBackgroundRule(s,'.Rico_accTitle',ConfigObj.imgHeading,repeat,pos); } + + if (ConfigObj.enableLogging) this.enableLogging(); + if (ConfigObj.enableHTML5) this._CheckInputTypes(); }, - addCssRule: function(sheet,selector,imageUrl,repeat) { + addCssBackgroundRule: function(sheet,selector,imageUrl,repeat,position) { if (!imageUrl) return; - var rule="background:url('"+imageUrl+"') "+repeat; + this.addCssRule(sheet,selector,"background-image:url('"+imageUrl+"')"); + this.addCssRule(sheet,selector,"background-repeat:"+repeat); + if (position) this.addCssRule(sheet,selector,"background-position:"+position); + }, + + addCssRule: function(sheet,selector,rule) { if (sheet.addRule) { sheet.addRule(selector, rule); } else if (sheet.insertRule) { @@ -76,13 +78,6 @@ var Rico = { } }, - languageInclude : function(lang2) { - var el = document.createElement('script'); - el.type = 'text/javascript'; - el.src = this.jsDir+"ricoLocale_"+lang2+".js"; - document.getElementsByTagName('head')[0].appendChild(el); - }, - // called by the document onload event windowLoaded: function() { this.windowIsLoaded=true; @@ -92,6 +87,16 @@ var Rico = { if (callback) callback(); } }, + + // check for availability of HTML5 input types + _CheckInputTypes: function() { + var i = document.createElement("input"); + for (var itype in this.inputtypes) { + i.setAttribute("type", "text"); + i.setAttribute("type", itype); + this.inputtypes[itype]=(i.type !== "text"); + } + }, onLoad: function(callback,frontOfQ) { if (frontOfQ) @@ -551,19 +556,18 @@ getPhraseById: function(phraseId) { * Format a positive number (integer or float) * @param posnum number to format * @param decPlaces the number of digits to display after the decimal point - * @param thouSep the character to use as the thousands separator - * @param decPoint the character to use as the decimal point + * @param thouSep boolean indicating whether to insert thousands separator * @returns formatted string */ -formatPosNumber: function(posnum,decPlaces,thouSep,decPoint) { +formatPosNumber: function(posnum,decPlaces,thouSep) { var a=posnum.toFixed(decPlaces).split(/\./); if (thouSep) { var rgx = /(\d+)(\d{3})/; while (rgx.test(a[0])) { - a[0]=a[0].replace(rgx, '$1'+thouSep+'$2'); + a[0]=a[0].replace(rgx, '$1'+Rico.thouSep+'$2'); } } - return a.join(decPoint); + return a.join(Rico.decPoint); }, /** @@ -575,8 +579,7 @@ formatPosNumber: function(posnum,decPlaces,thouSep,decPoint) { * @param fmt may contain any of the following:
    *
    multiplier
    the original number is multiplied by this amount before formatting
    *
    decPlaces
    number of digits to the right of the decimal point
    - *
    decPoint
    character to be used as the decimal point
    - *
    thouSep
    character to use as the thousands separator
    + *
    thouSep
    boolean indicating whether to insert thousands separator
    *
    prefix
    string added to the beginning of the result (e.g. a currency symbol)
    *
    suffix
    string added to the end of the result (e.g. % symbol)
    *
    negSign
    specifies format for negative numbers: L=leading minus, T=trailing minus, P=parens
    @@ -587,15 +590,14 @@ formatNumber : function(n,fmt) { if (isNaN(n)) return 'NaN'; if (typeof fmt.multiplier=='number') n*=fmt.multiplier; var decPlaces=typeof fmt.decPlaces=='number' ? fmt.decPlaces : 0; - var thouSep=typeof fmt.thouSep=='string' ? fmt.thouSep : this.thouSep; - var decPoint=typeof fmt.decPoint=='string' ? fmt.decPoint : this.decPoint; + var thouSep=typeof fmt.thouSep=='undefined' ? true : this.thouSep; var prefix=fmt.prefix || ""; var suffix=fmt.suffix || ""; var negSign=typeof fmt.negSign=='string' ? fmt.negSign : "L"; negSign=negSign.toUpperCase(); var s,cls; if (n<0.0) { - s=this.formatPosNumber(-n,decPlaces,thouSep,decPoint); + s=this.formatPosNumber(-n,decPlaces,thouSep); if (negSign=="P") s="("+s+")"; s=prefix+s; if (negSign=="L") s="-"+s; @@ -603,7 +605,7 @@ formatNumber : function(n,fmt) { cls='negNumber'; } else { cls=n==0.0 ? 'zeroNumber' : 'posNumber'; - s=prefix+this.formatPosNumber(n,decPlaces,thouSep,decPoint); + s=prefix+this.formatPosNumber(n,decPlaces,thouSep); } return ""+s+suffix+""; }, @@ -641,7 +643,7 @@ formatDate : function(d,fmt) { datefmt=this.dateFmt; break; } - return datefmt.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi, + return datefmt.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|d|hh|nn|ss|a\/p)/gi, function($1) { var h; switch ($1) { diff --git a/ricoClient/js/rico_min.js b/ricoClient/js/rico_min.js index b48b3fa..cdc61e0 100644 --- a/ricoClient/js/rico_min.js +++ b/ricoClient/js/rico_min.js @@ -1547,7 +1547,6 @@ this.loadXMLDoc(g.name) }}}; if(typeof Rico=="undefined"){throw ("GridCommon requires the Rico JavaScript framework") }Rico.GridCommon={baseInit:function(){this.options={saveColumnInfo:{width:true,filter:false,sort:false},cookiePrefix:"RicoGrid.",allowColResize:true,windowResize:true,click:null,dblclick:null,contextmenu:null,menuEvent:"dblclick",defaultWidth:-1,scrollBarWidth:19,minScrollWidth:100,frozenColumns:0,exportWindow:"height=400,width=500,scrollbars=1,menubar=1,resizable=1,location=0,toolbar=0,status=0",exportStyleList:["background-color","color","text-align","font-weight","font-size","font-family"],exportImgTags:false,exportFormFields:true,FilterLocation:null,FilterAllToken:"___ALL___",columnSpecs:[]}; -this.colWidths=[]; this.hdrCells=[]; this.headerColCnt=0; this.headerRowIdx=0; @@ -1938,7 +1937,7 @@ a++){b.push(escape(c.filterValues[a])) }d.push("f"+e+":"+b.join("~")) }}Rico.setCookie(this.options.cookiePrefix+this.tableId,d.join(","),this.options.cookieDays,this.options.cookiePath,this.options.cookieDomain) }}; -Rico.ColumnConst={UNFILTERED:0,SYSTEMFILTER:1,USERFILTER:2,UNSORTED:0,SORT_ASC:"ASC",SORT_DESC:"DESC",MINWIDTH:10,DOLLAR:{type:"number",prefix:"$",decPlaces:2,ClassName:"alignright"},EURO:{type:"number",prefix:"€",decPlaces:2,ClassName:"alignright"},PERCENT:{type:"number",suffix:"%",decPlaces:2,multiplier:100,ClassName:"alignright"},QTY:{type:"number",decPlaces:0,ClassName:"alignright"},DEFAULT:{type:"showTags"}}; +Rico.ColumnConst={UNFILTERED:0,SYSTEMFILTER:1,USERFILTER:2,UNSORTED:0,SORT_ASC:"ASC",SORT_DESC:"DESC",MINWIDTH:10}; Rico.TableColumnBase=function(){}; Rico.TableColumnBase.prototype={baseInit:function(h,g,e,d){Rico.log("TableColumnBase.init index="+g+" tabIdx="+d); this.liveGrid=h; @@ -1961,14 +1960,9 @@ this.mouseMoveHandler=Rico.eventHandle(this,"handleMouseMove"); this.mouseUpHandler=Rico.eventHandle(this,"handleMouseUp"); this.mouseOutHandler=Rico.eventHandle(this,"handleMouseOut"); this.fieldName="col"+this.index; +this.format={type:"text"}; var b=h.options.columnSpecs[g]; -this.format=Rico.extend({},Rico.ColumnConst.DEFAULT); -switch(typeof b){case"object":if(typeof b.format=="string"){Rico.extend(this.format,Rico.ColumnConst[b.format.toUpperCase()]) -}Rico.extend(this.format,b); -break; -case"string":if(b.slice(0,4)=="spec"){b=b.slice(4).toUpperCase() -}if(typeof Rico.ColumnConst[b]=="object"){Rico.extend(this.format,Rico.ColumnConst[b]) -}break +if(typeof b=="object"){Rico.extend(this.format,b) }Rico.addClass(this.dataColDiv,this.colClassName()); this.visible=true; if(typeof this.format.visible=="boolean"){this.visible=this.format.visible @@ -1999,19 +1993,10 @@ Rico.eventBind(a,"mousedown",this.mouseDownHandler,false) if(b.length>0){return b[0].innerHTML }else{return Rico.stripTags(a.innerHTML) }},_clear:function(a){a.innerHTML=" " -},clearCell:function(d){var c=this.cell(d); -this._clear(c,d); -if(!this.liveGrid.buffer){return -}var b=this.liveGrid.buffer.options.acceptAttr; -for(var a=0; -a=this.windowEnd){return false @@ -2495,7 +2463,7 @@ if(typeof a=="string"){this.rows[d][b]._style=a return true },getRows:function(f,d){var e=f-this.startPos; var a=Math.min(e+d,this.size); -var c=new Array(); +var c=[]; for(var b=e; b0; -j++){if(a[0].className=="ricoFrozen"){if(e==this.headerRowIdx){this.options.frozenColumns=j+1 +j++){if(Rico.hasClass(a[0],"ricoFrozen")){if(e==this.headerRowIdx){this.options.frozenColumns=j+1 }}else{d=1 }this.thead[d].rows[e].appendChild(a[0]) }}}Rico.log("loadHdrSrc end") @@ -3488,9 +3456,9 @@ Rico.LiveGridColumn=function(a,d,c,b){this.initialize(a,d,c,b) Rico.LiveGridColumn.prototype={initialize:function(liveGrid,colIdx,hdrInfo,tabIdx){Rico.extend(this,new Rico.TableColumnBase()); this.baseInit(liveGrid,colIdx,hdrInfo,tabIdx); this.buffer=liveGrid.buffer; -if(typeof(this.format.type)!="string"||this.format.EntryType=="tinyMCE"){this.format.type="raw" +if(typeof(this.format.type)!="string"||this.format.EntryType=="tinyMCE"){this.format.type="html" }if(typeof this.isNullable!="boolean"){this.isNullable=/number|date/.test(this.format.type) -}this.isText=/raw|text|showTags/.test(this.format.type); +}this.isText=/html|text/.test(this.format.type); Rico.log(" sortable="+this.sortable+" filterable="+this.filterable+" hideable="+this.hideable+" isNullable="+this.isNullable+" isText="+this.isText); this.fixHeaders(this.liveGrid.tableId,this.options.hdrIconsFirst); if(this["format_"+this.format.type]){this._format=this["format_"+this.format.type] @@ -3611,8 +3579,6 @@ b++){this.mFilterInputs[b].checked=a },mFilterOtherClick:function(a){this.mFilterInputs[0].checked=false; this.mFilterChange=true },format_text:function(a){if(typeof a!="string"){return" " -}else{return Rico.stripTags(a) -}},format_showTags:function(a){if(typeof a!="string"){return" " }else{return a.replace(/&/g,"&").replace(//g,">") }},format_number:function(a){if(typeof a=="undefined"||a==""||a==null){return" " }else{return Rico.formatNumber(a,this.format) @@ -3620,7 +3586,7 @@ this.mFilterChange=true }else{var b=Rico.setISO8601(a); if(!b){return a }return(this.format.prefix||"")+Rico.formatDate(b,this.format.dateFmt||"translateDateTime")+(this.format.suffix||"") -}},format_UTCasLocalTime:function(a){if(typeof a=="undefined"||a==""||a==null){return" " +}},format_utcaslocaltime:function(a){if(typeof a=="undefined"||a==""||a==null){return" " }else{var c=new Date(); var b=Rico.setISO8601(a,-c.getTimezoneOffset()); if(!b){return a @@ -3649,31 +3615,19 @@ this.hdrCellDiv.appendChild(this.imgSort) }if(!this.format.filterUI){Rico.eventBind(this.imgFilter,"click",Rico.eventHandle(this,"filterClick"),false) }},filterClick:function(a){if(this.filterType==Rico.ColumnConst.USERFILTER&&this.filterOp=="LIKE"){this.liveGrid.openKeyword(this.index) }},getValue:function(a){return this.buffer.getWindowCell(a,this.index) -},getBufferAttr:function(a){return this.buffer.getWindowAttr(a,this.index) +},getBufferStyle:function(a){return this.buffer.getWindowStyle(a,this.index) },setValue:function(b,a){this.buffer.setWindowValue(b,this.index,a) },_format:function(a){return a },_display:function(a,b){b.innerHTML=this._format(a) },_export:function(a){return this._format(a) },exportBuffer:function(a){return this._export(this.buffer.getValue(a,this.index)) -},displayValue:function(f){var a=this.getValue(f); -if(a==null){this.clearCell(f); +},displayValue:function(c){var a=this.getValue(c); +if(a==null){this.clearCell(c); return -}var e=this.cell(f); -this._display(a,e,f); -var d=this.buffer.options.acceptAttr; -if(d.length==0){return -}var c=this.getBufferAttr(f); -if(c==null){return -}for(var b=0; -b0){this.filtermenu.addMenuItemId("gridmenuRefresh",function(){o.filterHandler() -},true); -this.filtermenu.addMenuItemId("gridmenuRemoveAll",function(){o.clearFilters() +}}}if(o.filterCount()>0){this.filtermenu.addMenuItemId("gridmenuRemoveAll",function(){o.clearFilters() },true) -}}else{if(o.filterCount()>0){this.addSubMenuItem(Rico.getPhraseById("gridmenuFilterBy",d.displayName),this.filtermenu,false); -this.filtermenu.addMenuItemId("gridmenuRemoveAll",function(){o.clearFilters() +}this.filtermenu.addMenuItemId("gridmenuRefresh",function(){o.filterHandler() },true) -}}this.exportmenu.clearMenu(); -if(f.printVisibleSQL&&typeof(f.dataSource)=="string"){this.addSubMenuItem(Rico.getPhraseById("gridmenuExport"),this.exportmenu,false); -this.exportmenu.addMenuItemId("gridmenuExportVis2Web",function(){f.printVisibleSQL("html") +}this.exportmenu.clearMenu(); +if(n>0){this.addSubMenuItem(Rico.getPhraseById("gridmenuExport"),this.exportmenu,false); +if(f.printVisibleSQL&&typeof(f.dataSource)=="string"){this.exportmenu.addMenuItemId("gridmenuExportVis2Web",function(){f.printVisibleSQL("html") }); this.exportmenu.addMenuItemId("gridmenuExportAll2Web",function(){f.printAllSQL("html") },f.totalRows<=n); @@ -3917,7 +3868,7 @@ this.exportmenu.addMenuItemId("gridmenuExportVis2SS",function(){f.printVisibleSQ }); this.exportmenu.addMenuItemId("gridmenuExportAll2SS",function(){f.printAllSQL("xl") },f.totalRows<=n) -}else{if(n>0&&m>0){this.addSubMenuItem(Rico.getPhraseById("gridmenuExport"),this.exportmenu,false); +}else{this.addSubMenuItem(Rico.getPhraseById("gridmenuExport"),this.exportmenu,false); this.exportmenu.addMenuItemId("gridmenuExportVis2Web",function(){f.printVisible() }); this.exportmenu.addMenuItemId("gridmenuExportAll2Web",function(){f.printAll() @@ -3993,7 +3944,7 @@ d[h]=a },clearTimer:function(){if(typeof this.timeoutHandler!="number"){return }window.clearTimeout(this.timeoutHandler); delete this.timeoutHandler -},jsUpdate:function(a,c,f,b,d){this.clearTimer(); +},jsUpdate:function(a,c,e,b,d){this.clearTimer(); this.processingRequest=false; Rico.log("jsUpdate: "+arguments.length); if(d){Rico.log("jsUpdate: received error="+d); @@ -4004,14 +3955,14 @@ if(typeof b=="number"){this.rowcntContent=b.toString(); this.rcvdRowCount=true; this.foundRowCount=true; Rico.log("jsUpdate: found RowCount="+this.rowcntContent) -}this.updateBuffer(a,c,f); +}this.updateBuffer(a,c,e); if(this.options.onAjaxUpdate){this.options.onAjaxUpdate() }this.updateGrid(a); if(this.options.TimeOut&&this.timerMsg){this.restartSessionTimer() -}if(this.pendingRequest>=-1){var e=this.pendingRequest; -Rico.log("jsUpdate: found pending request for offset="+e); +}if(this.pendingRequest>=-1){var f=this.pendingRequest; +Rico.log("jsUpdate: found pending request for offset="+f); this.pendingRequest=-2; -this.fetch(e) +this.fetch(f) }},ajaxUpdate:function(a,c){this.clearTimer(); this.processingRequest=false; if(c.status!=200){Rico.log("ajaxUpdate: received http error="+c.status); @@ -4035,25 +3986,27 @@ o.loadXML(f.responseText.substring(m+3)) }if(!o){alert("Data provider returned an invalid XML response"); Rico.log("Data provider returned an invalid XML response"); return false -}var e=o.getElementsByTagName("ajax-response"); -if(e==null||e.length!=1){return false -}this.rcvdRows=0; +}var d=o.getElementsByTagName("ajax-response"); +if(d==null||d.length!=1){alert("Received invalid response from server"); +return false +}Rico.log("Processing ajax-response"); +this.rcvdRows=0; this.rcvdRowCount=false; -var c=e[0]; -var a=c.getElementsByTagName("debug"); +var b=d[0]; +var a=b.getElementsByTagName("debug"); for(var g=0; g0){var d=Rico.getContentAsString(l[0],this.options.isEncoded); -alert("Data provider returned an error:\n"+d); -Rico.log("Data provider returned an error:\n"+d); +}var l=b.getElementsByTagName("error"); +if(l.length>0){var c=Rico.getContentAsString(l[0],this.options.isEncoded); +alert("Data provider returned an error:\n"+c); +Rico.log("Data provider returned an error:\n"+c); return false -}var j=c.getElementsByTagName("rows")[0]; +}var j=b.getElementsByTagName("rows")[0]; if(!j){Rico.log("ajaxUpdate: invalid response"); this.liveGrid.showMsg(Rico.getPhraseById("invalidResponse")); return false -}var n=c.getElementsByTagName("rowcount"); +}var n=b.getElementsByTagName("rowcount"); if(n&&n.length==1){this.rowcntContent=Rico.getContentAsString(n[0],this.options.isEncoded); this.rcvdRowCount=true; this.foundRowCount=true; @@ -4062,10 +4015,24 @@ Rico.log("ajaxUpdate: found RowCount="+this.rowcntContent) this.rcvdOffset=j.getAttribute("offset"); Rico.log("ajaxUpdate: rcvdOffset="+this.rcvdOffset); var h=this.dom2jstable(j); -var b=(this.options.acceptAttr.length>0)?this.dom2jstableAttr(j):false; +var e=(this.options.acceptStyle)?this.dom2jstableStyle(j):false; this.rcvdRows=h.length; -this.updateBuffer(k,h,b); +this.updateBuffer(k,h,e); return true +},dom2jstableStyle:function(e,b){var a=this.options.acceptStyle; +Rico.log("dom2jstableStyle start"); +var f=[]; +var g=e.getElementsByTagName("tr"); +for(var d=b||0; +d