/pyjs/tests/test028.py

http://pyjamas.googlecode.com/ · Python · 37 lines · 24 code · 13 blank · 0 comment · 4 complexity · 34b303f3962a3c69b5728eda04ae6ed6 MD5 · raw file

  1. class RowDataAcceptorImpl:
  2. def accept(self, startRow, data):
  3. destRowCount = getDataRowCount()
  4. destColCount = grid.getCellCount(0)
  5. srcRowIndex = 0
  6. srcRowCount = 5
  7. destRowIndex = 1
  8. while srcRowIndex < srcRowCount:
  9. srcRowData = data[srcRowIndex]
  10. for srcColIndex in range(destColCount):
  11. cellHTML = srcRowData[srcColIndex]
  12. grid.setText(destRowIndex, srcColIndex, cellHTML)
  13. srcRowIndex += 1
  14. destRowIndex += 1
  15. isLastPage = False
  16. while destRowIndex < destRowCount + 1:
  17. isLastPage = True
  18. for destColIndex in range(destColCount):
  19. grid.clearCell(destRowIndex, destColIndex)
  20. destRowIndex += 1
  21. navbar.gotoNet.setEnabled(not isLstPage)
  22. navbar.gotoFirst.setEnabled(startRow > 0)
  23. navbar.gotoPrev.setEnabled(startRow > 0)
  24. setStatusText((startRow + 1) + " - " + (startRow + srcRowCount))