Advertisement
Guest User

Untitled

a guest
May 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. internalSetAllColumn: function(column, newValue) {
  2. column.masterValue = newValue;
  3. column.header = '<div class="x-grid3-check-col-td loading-indicator">&#160;</div>'; // loading icon
  4. this.grid.getView().updateHeaders();
  5. (function() {
  6. this.grid.getStore().each(function(rec) {
  7. if (this.isCellEditable(rec)) {
  8. rec.set(this.dataIndex, newValue);
  9. }
  10. }, this);
  11. column.renderHeaderCheck();
  12. this.grid.getView().updateHeaders();
  13. }).defer(50, this);
  14. }
  15.  
  16. this.grid.getStore().each(function(rec) {
  17. rec.set.defer(1, rec, [this.dataIndex, newValue]);
  18. }, this);
  19. column.renderHeaderCheck();
  20. this.grid.getView().updateHeaders();
  21.  
  22. internalSetAllColumn: function(column, newValue) {
  23. var store = this.grid.getStore(),
  24. gridView = this.grid.getView();
  25.  
  26. column.masterValue = newValue;
  27.  
  28. store.suspendEvents();
  29. store.each(function(rec) {
  30. rec.set(this.dataIndex, newValue);
  31. }, this);
  32. store.resumeEvents();
  33.  
  34. column.renderHeaderCheck();
  35. gridView.refresh();
  36. }
  37.  
  38. var task = {
  39. run: function(){
  40. Ext.fly('clock').update(new Date().format('g:i:s A'));
  41. },
  42. interval: 1000 //1 second
  43. }
  44. Ext.TaskMgr.start(task);
  45.  
  46. internalSetAllColumn: function(column, newValue) {
  47. column.masterValue = newValue;
  48. column.header = '<div class="x-grid3-check-col-td loading-indicator">&#160;</div>'; // loading icon
  49. this.grid.getView().updateHeaders();
  50. var store = this.grid.getStore();
  51. var count = store.getCount();
  52. var step = 5;
  53. var times = (count / step) >> 0;
  54. var task = {
  55. run: function() {
  56. var last = step * task.taskRunCount;
  57. var first = last - step;
  58. if (first <= count) {
  59. var recs = store.getRange(first, last);
  60. Ext.each(recs, function(rec) {
  61. rec.set(this.dataIndex, newValue);
  62. }, this);
  63. }
  64. if (task.taskRunCount > times) {
  65. column.renderHeaderCheck();
  66. this.grid.getView().updateHeaders();
  67. return false;
  68. }
  69. },
  70. interval: 1,
  71. scope: this
  72. };
  73. Ext.TaskMgr.start(task);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement