List.js 825 B

123456789101112131415161718192021222324252627
  1. Ext.define('SimpleTasks.model.List', {
  2. extend: 'Ext.data.Model',
  3. fields: [
  4. { name: 'id', type: 'int' },
  5. { name: 'name' },
  6. // if we are using local storage, we need to persist the index field so the ordering of tree nodes will be preserved
  7. {name: 'index', type: 'int', defaultValue: null, persist: !!SimpleTasksSettings.useLocalStorage}
  8. ],
  9. proxy: SimpleTasksSettings.useLocalStorage ? {
  10. type: 'localstorage',
  11. id: 'SimpleTasks-List'
  12. } : {
  13. type: 'ajax',
  14. api: {
  15. create: 'php/list/create.php',
  16. read: 'php/list/read.php',
  17. update: 'php/list/update.php',
  18. destroy: 'php/list/delete.php'
  19. },
  20. reader: {
  21. type: 'json',
  22. messageProperty: 'message'
  23. }
  24. }
  25. });