View3.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-tree-View'>/**
  19. </span> * Used as a view by {@link Ext.tree.Panel TreePanel}.
  20. */
  21. Ext.define('Ext.tree.View', {
  22. extend: 'Ext.view.Table',
  23. alias: 'widget.treeview',
  24. requires: [
  25. 'Ext.data.NodeStore'
  26. ],
  27. loadingCls: Ext.baseCSSPrefix + 'grid-tree-loading',
  28. expandedCls: Ext.baseCSSPrefix + 'grid-tree-node-expanded',
  29. leafCls: Ext.baseCSSPrefix + 'grid-tree-node-leaf',
  30. expanderSelector: '.' + Ext.baseCSSPrefix + 'tree-expander',
  31. checkboxSelector: '.' + Ext.baseCSSPrefix + 'tree-checkbox',
  32. expanderIconOverCls: Ext.baseCSSPrefix + 'tree-expander-over',
  33. // Class to add to the node wrap element used to hold nodes when a parent is being
  34. // collapsed or expanded. During the animation, UI interaction is forbidden by testing
  35. // for an ancestor node with this class.
  36. nodeAnimWrapCls: Ext.baseCSSPrefix + 'tree-animator-wrap',
  37. blockRefresh: true,
  38. <span id='Ext-tree-View-cfg-loadMask'> /**
  39. </span> * @cfg
  40. * @inheritdoc
  41. */
  42. loadMask: false,
  43. <span id='Ext-tree-View-cfg-rootVisible'> /**
  44. </span> * @cfg {Boolean} rootVisible
  45. * False to hide the root node.
  46. */
  47. rootVisible: true,
  48. <span id='Ext-tree-View-cfg-deferInitialRefresh'> /**
  49. </span> * @cfg {Boolean} deferInitialRefresh
  50. * Must be false for Tree Views because the root node must be rendered in order to be updated with its child nodes.
  51. */
  52. deferInitialRefresh: false,
  53. <span id='Ext-tree-View-cfg-animate'> /**
  54. </span> * @cfg {Boolean} animate
  55. * True to enable animated expand/collapse (defaults to the value of {@link Ext#enableFx Ext.enableFx})
  56. */
  57. expandDuration: 250,
  58. collapseDuration: 250,
  59. toggleOnDblClick: true,
  60. stripeRows: false,
  61. // fields that will trigger a change in the ui that aren't likely to be bound to a column
  62. uiFields: ['expanded', 'loaded', 'checked', 'expandable', 'leaf', 'icon', 'iconCls', 'loading', 'qtip', 'qtitle'],
  63. initComponent: function() {
  64. var me = this,
  65. treeStore = me.panel.getStore();
  66. if (me.initialConfig.animate === undefined) {
  67. me.animate = Ext.enableFx;
  68. }
  69. me.store = new Ext.data.NodeStore({
  70. treeStore: treeStore,
  71. recursive: true,
  72. rootVisible: me.rootVisible,
  73. listeners: {
  74. beforeexpand: me.onBeforeExpand,
  75. expand: me.onExpand,
  76. beforecollapse: me.onBeforeCollapse,
  77. collapse: me.onCollapse,
  78. write: me.onStoreWrite,
  79. datachanged: me.onStoreDataChanged,
  80. scope: me
  81. }
  82. });
  83. if (me.node) {
  84. me.setRootNode(me.node);
  85. }
  86. me.animQueue = {};
  87. me.animWraps = {};
  88. me.addEvents(
  89. <span id='Ext-tree-View-event-afteritemexpand'> /**
  90. </span> * @event afteritemexpand
  91. * Fires after an item has been visually expanded and is visible in the tree.
  92. * @param {Ext.data.NodeInterface} node The node that was expanded
  93. * @param {Number} index The index of the node
  94. * @param {HTMLElement} item The HTML element for the node that was expanded
  95. */
  96. 'afteritemexpand',
  97. <span id='Ext-tree-View-event-afteritemcollapse'> /**
  98. </span> * @event afteritemcollapse
  99. * Fires after an item has been visually collapsed and is no longer visible in the tree.
  100. * @param {Ext.data.NodeInterface} node The node that was collapsed
  101. * @param {Number} index The index of the node
  102. * @param {HTMLElement} item The HTML element for the node that was collapsed
  103. */
  104. 'afteritemcollapse'
  105. );
  106. me.callParent(arguments);
  107. me.on({
  108. element: 'el',
  109. scope: me,
  110. delegate: me.expanderSelector,
  111. mouseover: me.onExpanderMouseOver,
  112. mouseout: me.onExpanderMouseOut
  113. });
  114. me.on({
  115. element: 'el',
  116. scope: me,
  117. delegate: me.checkboxSelector,
  118. click: me.onCheckboxChange
  119. });
  120. },
  121. getMaskStore: function(){
  122. return this.panel.getStore();
  123. },
  124. afterComponentLayout: function(){
  125. this.callParent(arguments);
  126. var stretcher = this.stretcher;
  127. if (stretcher) {
  128. stretcher.setWidth((this.getWidth() - Ext.getScrollbarSize().width));
  129. }
  130. },
  131. processUIEvent: function(e) {
  132. // If the clicked node is part of an animation, ignore the click.
  133. // This is because during a collapse animation, the associated Records
  134. // will already have been removed from the Store, and the event is not processable.
  135. if (e.getTarget('.' + this.nodeAnimWrapCls, this.el)) {
  136. return false;
  137. }
  138. return this.callParent(arguments);
  139. },
  140. onClear: function(){
  141. this.store.removeAll();
  142. },
  143. setRootNode: function(node) {
  144. var me = this;
  145. me.store.setNode(node);
  146. me.node = node;
  147. },
  148. onCheckboxChange: function(e, t) {
  149. var me = this,
  150. item = e.getTarget(me.getItemSelector(), me.getTargetEl());
  151. if (item) {
  152. me.onCheckChange(me.getRecord(item));
  153. }
  154. },
  155. onCheckChange: function(record){
  156. var checked = record.get('checked');
  157. if (Ext.isBoolean(checked)) {
  158. checked = !checked;
  159. record.set('checked', checked);
  160. this.fireEvent('checkchange', record, checked);
  161. }
  162. },
  163. getChecked: function() {
  164. var checked = [];
  165. this.node.cascadeBy(function(rec){
  166. if (rec.get('checked')) {
  167. checked.push(rec);
  168. }
  169. });
  170. return checked;
  171. },
  172. isItemChecked: function(rec){
  173. return rec.get('checked');
  174. },
  175. <span id='Ext-tree-View-method-createAnimWrap'> /**
  176. </span> * @private
  177. */
  178. createAnimWrap: function(record, index) {
  179. var thHtml = '',
  180. headerCt = this.panel.headerCt,
  181. headers = headerCt.getGridColumns(),
  182. i = 0, len = headers.length, item,
  183. node = this.getNode(record),
  184. tmpEl, nodeEl;
  185. for (; i &lt; len; i++) {
  186. item = headers[i];
  187. thHtml += '&lt;th style=&quot;width: ' + (item.hidden ? 0 : item.getDesiredWidth()) + 'px; height: 0px;&quot;&gt;&lt;/th&gt;';
  188. }
  189. nodeEl = Ext.get(node);
  190. tmpEl = nodeEl.insertSibling({
  191. tag: 'tr',
  192. html: [
  193. '&lt;td colspan=&quot;' + headerCt.getColumnCount() + '&quot;&gt;',
  194. '&lt;div class=&quot;' + this.nodeAnimWrapCls + '&quot;&gt;',
  195. '&lt;table class=&quot;' + Ext.baseCSSPrefix + 'grid-table&quot; style=&quot;width: ' + headerCt.getFullWidth() + 'px;&quot;&gt;&lt;tbody&gt;',
  196. thHtml,
  197. '&lt;/tbody&gt;&lt;/table&gt;',
  198. '&lt;/div&gt;',
  199. '&lt;/td&gt;'
  200. ].join('')
  201. }, 'after');
  202. return {
  203. record: record,
  204. node: node,
  205. el: tmpEl,
  206. expanding: false,
  207. collapsing: false,
  208. animating: false,
  209. animateEl: tmpEl.down('div'),
  210. targetEl: tmpEl.down('tbody')
  211. };
  212. },
  213. <span id='Ext-tree-View-method-getAnimWrap'> /**
  214. </span> * @private
  215. * Returns the animation wrapper element for the specified parent node, used to wrap the child nodes as
  216. * they slide up or down during expand/collapse.
  217. *
  218. * @param parent The parent node to be expanded or collapsed
  219. *
  220. * @param [bubble=true] If the passed parent node does not already have a wrap element created, by default
  221. * this function will bubble up to each parent node looking for a valid wrap element to reuse, returning
  222. * the first one it finds. This is the appropriate behavior, e.g., for the collapse direction, so that the
  223. * entire expanded set of branch nodes can collapse as a single unit.
  224. *
  225. * However for expanding each parent node should instead always create its own animation wrap if one
  226. * doesn't exist, so that its children can expand independently of any other nodes -- this is crucial
  227. * when executing the &quot;expand all&quot; behavior. If multiple nodes attempt to reuse the same ancestor wrap
  228. * element concurrently during expansion it will lead to problems as the first animation to complete will
  229. * delete the wrap el out from under other running animations. For that reason, when expanding you should
  230. * always pass `bubble: false` to be on the safe side.
  231. *
  232. * If the passed parent has no wrap (or there is no valid ancestor wrap after bubbling), this function
  233. * will return null and the calling code should then call {@link #createAnimWrap} if needed.
  234. *
  235. * @return {Ext.Element} The wrapping element as created in {@link #createAnimWrap}, or null
  236. */
  237. getAnimWrap: function(parent, bubble) {
  238. if (!this.animate) {
  239. return null;
  240. }
  241. var wraps = this.animWraps,
  242. wrap = wraps[parent.internalId];
  243. if (bubble !== false) {
  244. while (!wrap &amp;&amp; parent) {
  245. parent = parent.parentNode;
  246. if (parent) {
  247. wrap = wraps[parent.internalId];
  248. }
  249. }
  250. }
  251. return wrap;
  252. },
  253. doAdd: function(nodes, records, index) {
  254. // If we are adding records which have a parent that is currently expanding
  255. // lets add them to the animation wrap
  256. var me = this,
  257. record = records[0],
  258. parent = record.parentNode,
  259. a = me.all.elements,
  260. relativeIndex = 0,
  261. animWrap = me.getAnimWrap(parent),
  262. targetEl, children, len;
  263. if (!animWrap || !animWrap.expanding) {
  264. return me.callParent(arguments);
  265. }
  266. // We need the parent that has the animWrap, not the nodes parent
  267. parent = animWrap.record;
  268. // If there is an anim wrap we do our special magic logic
  269. targetEl = animWrap.targetEl;
  270. children = targetEl.dom.childNodes;
  271. // We subtract 1 from the childrens length because we have a tr in there with the th'es
  272. len = children.length - 1;
  273. // The relative index is the index in the full flat collection minus the index of the wraps parent
  274. relativeIndex = index - me.indexOf(parent) - 1;
  275. // If we are adding records to the wrap that have a higher relative index then there are currently children
  276. // it means we have to append the nodes to the wrap
  277. if (!len || relativeIndex &gt;= len) {
  278. targetEl.appendChild(nodes);
  279. }
  280. // If there are already more children then the relative index it means we are adding child nodes of
  281. // some expanded node in the anim wrap. In this case we have to insert the nodes in the right location
  282. else {
  283. // +1 because of the tr with th'es that is already there
  284. Ext.fly(children[relativeIndex + 1]).insertSibling(nodes, 'before', true);
  285. }
  286. // We also have to update the CompositeElementLite collection of the DataView
  287. Ext.Array.insert(a, index, nodes);
  288. // If we were in an animation we need to now change the animation
  289. // because the targetEl just got higher.
  290. if (animWrap.isAnimating) {
  291. me.onExpand(parent);
  292. }
  293. },
  294. beginBulkUpdate: function(){
  295. this.bulkUpdate = true;
  296. },
  297. endBulkUpdate: function(){
  298. this.bulkUpdate = false;
  299. },
  300. onRemove : function(ds, record, index) {
  301. var me = this,
  302. bulk = me.bulkUpdate;
  303. if (me.viewReady) {
  304. me.doRemove(record, index);
  305. if (!bulk) {
  306. me.updateIndexes(index);
  307. }
  308. if (me.store.getCount() === 0){
  309. me.refresh();
  310. }
  311. if (!bulk) {
  312. me.fireEvent('itemremove', record, index);
  313. }
  314. }
  315. },
  316. doRemove: function(record, index) {
  317. // If we are adding records which have a parent that is currently expanding
  318. // lets add them to the animation wrap
  319. var me = this,
  320. all = me.all,
  321. animWrap = me.getAnimWrap(record),
  322. item = all.item(index),
  323. node = item ? item.dom : null;
  324. if (!node || !animWrap || !animWrap.collapsing) {
  325. return me.callParent(arguments);
  326. }
  327. animWrap.targetEl.appendChild(node);
  328. all.removeElement(index);
  329. },
  330. onBeforeExpand: function(parent, records, index) {
  331. var me = this,
  332. animWrap;
  333. if (!me.rendered || !me.animate) {
  334. return;
  335. }
  336. if (me.getNode(parent)) {
  337. animWrap = me.getAnimWrap(parent, false);
  338. if (!animWrap) {
  339. animWrap = me.animWraps[parent.internalId] = me.createAnimWrap(parent);
  340. animWrap.animateEl.setHeight(0);
  341. }
  342. else if (animWrap.collapsing) {
  343. // If we expand this node while it is still expanding then we
  344. // have to remove the nodes from the animWrap.
  345. animWrap.targetEl.select(me.itemSelector).remove();
  346. }
  347. animWrap.expanding = true;
  348. animWrap.collapsing = false;
  349. }
  350. },
  351. onExpand: function(parent) {
  352. var me = this,
  353. queue = me.animQueue,
  354. id = parent.getId(),
  355. node = me.getNode(parent),
  356. index = node ? me.indexOf(node) : -1,
  357. animWrap,
  358. animateEl,
  359. targetEl;
  360. if (me.singleExpand) {
  361. me.ensureSingleExpand(parent);
  362. }
  363. // The item is not visible yet
  364. if (index === -1) {
  365. return;
  366. }
  367. animWrap = me.getAnimWrap(parent, false);
  368. if (!animWrap) {
  369. me.isExpandingOrCollapsing = false;
  370. me.fireEvent('afteritemexpand', parent, index, node);
  371. return;
  372. }
  373. animateEl = animWrap.animateEl;
  374. targetEl = animWrap.targetEl;
  375. animateEl.stopAnimation();
  376. // @TODO: we are setting it to 1 because quirks mode on IE seems to have issues with 0
  377. queue[id] = true;
  378. animateEl.slideIn('t', {
  379. duration: me.expandDuration,
  380. listeners: {
  381. scope: me,
  382. lastframe: function() {
  383. // Move all the nodes out of the anim wrap to their proper location
  384. animWrap.el.insertSibling(targetEl.query(me.itemSelector), 'before');
  385. animWrap.el.remove();
  386. me.refreshSize();
  387. delete me.animWraps[animWrap.record.internalId];
  388. delete queue[id];
  389. }
  390. },
  391. callback: function() {
  392. me.isExpandingOrCollapsing = false;
  393. me.fireEvent('afteritemexpand', parent, index, node);
  394. }
  395. });
  396. animWrap.isAnimating = true;
  397. },
  398. onBeforeCollapse: function(parent, records, index) {
  399. var me = this,
  400. animWrap;
  401. if (!me.rendered || !me.animate) {
  402. return;
  403. }
  404. if (me.getNode(parent)) {
  405. animWrap = me.getAnimWrap(parent);
  406. if (!animWrap) {
  407. animWrap = me.animWraps[parent.internalId] = me.createAnimWrap(parent, index);
  408. }
  409. else if (animWrap.expanding) {
  410. // If we collapse this node while it is still expanding then we
  411. // have to remove the nodes from the animWrap.
  412. animWrap.targetEl.select(this.itemSelector).remove();
  413. }
  414. animWrap.expanding = false;
  415. animWrap.collapsing = true;
  416. }
  417. },
  418. onCollapse: function(parent) {
  419. var me = this,
  420. queue = me.animQueue,
  421. id = parent.getId(),
  422. node = me.getNode(parent),
  423. index = node ? me.indexOf(node) : -1,
  424. animWrap = me.getAnimWrap(parent),
  425. animateEl, targetEl;
  426. // The item has already been removed by a parent node
  427. if (index === -1) {
  428. return;
  429. }
  430. if (!animWrap) {
  431. me.isExpandingOrCollapsing = false;
  432. me.fireEvent('afteritemcollapse', parent, index, node);
  433. return;
  434. }
  435. animateEl = animWrap.animateEl;
  436. targetEl = animWrap.targetEl;
  437. queue[id] = true;
  438. // @TODO: we are setting it to 1 because quirks mode on IE seems to have issues with 0
  439. animateEl.stopAnimation();
  440. animateEl.slideOut('t', {
  441. duration: me.collapseDuration,
  442. listeners: {
  443. scope: me,
  444. lastframe: function() {
  445. animWrap.el.remove();
  446. me.refreshSize();
  447. delete me.animWraps[animWrap.record.internalId];
  448. delete queue[id];
  449. }
  450. },
  451. callback: function() {
  452. me.isExpandingOrCollapsing = false;
  453. me.fireEvent('afteritemcollapse', parent, index, node);
  454. }
  455. });
  456. animWrap.isAnimating = true;
  457. },
  458. <span id='Ext-tree-View-method-isAnimating'> /**
  459. </span> * Checks if a node is currently undergoing animation
  460. * @private
  461. * @param {Ext.data.Model} node The node
  462. * @return {Boolean} True if the node is animating
  463. */
  464. isAnimating: function(node) {
  465. return !!this.animQueue[node.getId()];
  466. },
  467. collectData: function(records) {
  468. var data = this.callParent(arguments),
  469. rows = data.rows,
  470. len = rows.length,
  471. i = 0,
  472. row, record;
  473. for (; i &lt; len; i++) {
  474. row = rows[i];
  475. record = records[i];
  476. if (record.get('qtip')) {
  477. row.rowAttr = 'data-qtip=&quot;' + record.get('qtip') + '&quot;';
  478. if (record.get('qtitle')) {
  479. row.rowAttr += ' ' + 'data-qtitle=&quot;' + record.get('qtitle') + '&quot;';
  480. }
  481. }
  482. if (record.isExpanded()) {
  483. row.rowCls = (row.rowCls || '') + ' ' + this.expandedCls;
  484. }
  485. if (record.isLeaf()) {
  486. row.rowCls = (row.rowCls || '') + ' ' + this.leafCls;
  487. }
  488. if (record.isLoading()) {
  489. row.rowCls = (row.rowCls || '') + ' ' + this.loadingCls;
  490. }
  491. }
  492. return data;
  493. },
  494. <span id='Ext-tree-View-method-expand'> /**
  495. </span> * Expands a record that is loaded in the view.
  496. * @param {Ext.data.Model} record The record to expand
  497. * @param {Boolean} [deep] True to expand nodes all the way down the tree hierarchy.
  498. * @param {Function} [callback] The function to run after the expand is completed
  499. * @param {Object} [scope] The scope of the callback function.
  500. */
  501. expand: function(record, deep, callback, scope) {
  502. return record.expand(deep, callback, scope);
  503. },
  504. <span id='Ext-tree-View-method-collapse'> /**
  505. </span> * Collapses a record that is loaded in the view.
  506. * @param {Ext.data.Model} record The record to collapse
  507. * @param {Boolean} [deep] True to collapse nodes all the way up the tree hierarchy.
  508. * @param {Function} [callback] The function to run after the collapse is completed
  509. * @param {Object} [scope] The scope of the callback function.
  510. */
  511. collapse: function(record, deep, callback, scope) {
  512. return record.collapse(deep, callback, scope);
  513. },
  514. <span id='Ext-tree-View-method-toggle'> /**
  515. </span> * Toggles a record between expanded and collapsed.
  516. * @param {Ext.data.Model} record
  517. * @param {Boolean} [deep] True to collapse nodes all the way up the tree hierarchy.
  518. * @param {Function} [callback] The function to run after the expand/collapse is completed
  519. * @param {Object} [scope] The scope of the callback function.
  520. */
  521. toggle: function(record, deep, callback, scope) {
  522. var me = this,
  523. doAnimate = !!this.animate;
  524. // Block toggling if we are already animating an expand or collapse operation.
  525. if (!doAnimate || !this.isExpandingOrCollapsing) {
  526. if (!record.isLeaf()) {
  527. this.isExpandingOrCollapsing = doAnimate;
  528. }
  529. if (record.isExpanded()) {
  530. me.collapse(record, deep, callback, scope);
  531. } else {
  532. me.expand(record, deep, callback, scope);
  533. }
  534. }
  535. },
  536. onItemDblClick: function(record, item, index) {
  537. var me = this,
  538. editingPlugin = me.editingPlugin;
  539. me.callParent(arguments);
  540. if (me.toggleOnDblClick &amp;&amp; record.isExpandable() &amp;&amp; !(editingPlugin &amp;&amp; editingPlugin.clicksToEdit === 2)) {
  541. me.toggle(record);
  542. }
  543. },
  544. onBeforeItemMouseDown: function(record, item, index, e) {
  545. if (e.getTarget(this.expanderSelector, item)) {
  546. return false;
  547. }
  548. return this.callParent(arguments);
  549. },
  550. onItemClick: function(record, item, index, e) {
  551. if (e.getTarget(this.expanderSelector, item) &amp;&amp; record.isExpandable()) {
  552. this.toggle(record, e.ctrlKey);
  553. return false;
  554. }
  555. return this.callParent(arguments);
  556. },
  557. onExpanderMouseOver: function(e, t) {
  558. e.getTarget(this.cellSelector, 10, true).addCls(this.expanderIconOverCls);
  559. },
  560. onExpanderMouseOut: function(e, t) {
  561. e.getTarget(this.cellSelector, 10, true).removeCls(this.expanderIconOverCls);
  562. },
  563. <span id='Ext-tree-View-method-getTreeStore'> /**
  564. </span> * Gets the base TreeStore from the bound TreePanel.
  565. */
  566. getTreeStore: function() {
  567. return this.panel.store;
  568. },
  569. ensureSingleExpand: function(node) {
  570. var parent = node.parentNode;
  571. if (parent) {
  572. parent.eachChild(function(child) {
  573. if (child !== node &amp;&amp; child.isExpanded()) {
  574. child.collapse();
  575. }
  576. });
  577. }
  578. },
  579. shouldUpdateCell: function(column, changedFieldNames){
  580. if (changedFieldNames) {
  581. var i = 0,
  582. len = changedFieldNames.length;
  583. for (; i &lt; len; ++i) {
  584. if (Ext.Array.contains(this.uiFields, changedFieldNames[i])) {
  585. return true;
  586. }
  587. }
  588. }
  589. return this.callParent(arguments);
  590. },
  591. <span id='Ext-tree-View-method-onStoreWrite'> /**
  592. </span> * Re-fires the NodeStore's &quot;write&quot; event as a TreeStore event
  593. * @private
  594. * @param {Ext.data.NodeStore} store
  595. * @param {Ext.data.Operation} operation
  596. */
  597. onStoreWrite: function(store, operation) {
  598. var treeStore = this.panel.store;
  599. treeStore.fireEvent('write', treeStore, operation);
  600. },
  601. <span id='Ext-tree-View-method-onStoreDataChanged'> /**
  602. </span> * Re-fires the NodeStore's &quot;datachanged&quot; event as a TreeStore event
  603. * @private
  604. * @param {Ext.data.NodeStore} store
  605. * @param {Ext.data.Operation} operation
  606. */
  607. onStoreDataChanged: function(store, operation) {
  608. var treeStore = this.panel.store;
  609. treeStore.fireEvent('datachanged', treeStore);
  610. }
  611. });
  612. </pre>
  613. </body>
  614. </html>