PageRenderTime 350ms CodeModel.GetById 140ms app.highlight 8ms RepoModel.GetById 139ms app.codeStats 1ms

/pyjs/tests/test028.js

http://pyjamas.googlecode.com/
JavaScript | 60 lines | 50 code | 10 blank | 0 comment | 8 complexity | f79ed26c89c977669220a6b9e1577533 MD5 | raw file
 1__RowDataAcceptorImpl.prototype.__class__ = "RowDataAcceptorImpl";
 2function RowDataAcceptorImpl() {
 3    return new __RowDataAcceptorImpl();
 4}
 5function __RowDataAcceptorImpl() {
 6}
 7__RowDataAcceptorImpl.prototype.accept = function(startRow, data) {
 8    var destRowCount = getDataRowCount();
 9    var destColCount = grid.getCellCount(0);
10    var srcRowIndex = 0;
11    var srcRowCount = 5;
12    var destRowIndex = 1;
13    while ((srcRowIndex < srcRowCount)) {
14    var srcRowData = data.__getitem__(srcRowIndex);
15
16        var __srcColIndex = pyjslib_range(destColCount).__iter__();
17        try {
18            while (true) {
19                var srcColIndex = __srcColIndex.next();
20                
21        
22    var cellHTML = srcRowData.__getitem__(srcColIndex);
23    grid.setText(destRowIndex, srcColIndex, cellHTML);
24
25            }
26        } catch (e) {
27            if (e != StopIteration) {
28                throw e;
29            }
30        }
31        
32    srcRowIndex += 1;
33    destRowIndex += 1;
34    }
35    var isLastPage = false;
36    while ((destRowIndex <  ( destRowCount + 1 ) )) {
37    var isLastPage = true;
38
39        var __destColIndex = pyjslib_range(destColCount).__iter__();
40        try {
41            while (true) {
42                var destColIndex = __destColIndex.next();
43                
44        
45    grid.clearCell(destRowIndex, destColIndex);
46
47            }
48        } catch (e) {
49            if (e != StopIteration) {
50                throw e;
51            }
52        }
53        
54    destRowIndex += 1;
55    }
56    navbar.gotoNet.setEnabled(!(isLstPage));
57    navbar.gotoFirst.setEnabled((startRow > 0));
58    navbar.gotoPrev.setEnabled((startRow > 0));
59    setStatusText( (  (  ( startRow + 1 )  + " - " )  +  ( startRow + srcRowCount )  ) );
60};