Typica is a free program for professional coffee roasters. https://typica.us
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

departmentlist.xml 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <window id="departmentlist">
  2. <layout type="vertical">
  3. <layout type="horizontal">
  4. <!-- Reserved for filters, &c. -->
  5. </layout>
  6. <sqlview id="departments" />
  7. </layout>
  8. <menu name="File">
  9. <item id="newdepartment">New Department</item>
  10. </menu>
  11. <program>
  12. <![CDATA[
  13. var window = this;
  14. this.windowTitle = TTR("departmentlist", "Typica - Department List");
  15. var departments = findChildObject(this, "departments");
  16. var update = function() {
  17. departments.setQuery("SELECT id, name FROM depts ORDER BY id");
  18. };
  19. update();
  20. //var notification = Application.subscribe("deptschange");
  21. //notification.notify.connect(update);
  22. departments.openEntryRow.connect(function(row) {
  23. var args = new Object;
  24. args.newDepartment = false;
  25. args.currentName = departments.data(row, 1);
  26. args.departmentId = departments.data(row, 0);
  27. args.updateCallback = update;
  28. createWindow("renamedepartment", args);
  29. });
  30. var newdepartment = findChildObject(this, "newdepartment");
  31. newdepartment.triggered.connect(function() {
  32. var args = new Object;
  33. args.newDepartment = true;
  34. args.updateCallback = update;
  35. createWindow("renamedepartment", args);
  36. });
  37. ]]>
  38. </program>
  39. </window>