- var el = this.getTemplateTarget();
- el.update("");
- var records = this.store.getRange();
+ var el = this.getTemplateTarget(),
+ records = this.store.getRange();
+
+ el.update('');
* contain <i>named</i> properties.
*/
collectData : function(records, startIndex){
* contain <i>named</i> properties.
*/
collectData : function(records, startIndex){
- var r = [];
- for(var i = 0, len = records.length; i < len; i++){
- r[r.length] = this.prepareData(records[i].data, startIndex+i, records[i]);
+ var r = [],
+ i = 0,
+ len = records.length;
+ for(; i < len; i++){
+ r[r.length] = this.prepareData(records[i].data, startIndex + i, records[i]);
onUpdate : function(ds, record){
var index = this.store.indexOf(record);
if(index > -1){
onUpdate : function(ds, record){
var index = this.store.indexOf(record);
if(index > -1){
- var sel = this.isSelected(index);
- var original = this.all.elements[index];
- var node = this.bufferRender([record], index)[0];
+ var sel = this.isSelected(index),
+ original = this.all.elements[index],
+ node = this.bufferRender([record], index)[0];
this.store.un("add", this.onAdd, this);
this.store.un("remove", this.onRemove, this);
this.store.un("update", this.onUpdate, this);
this.store.un("add", this.onAdd, this);
this.store.un("remove", this.onRemove, this);
this.store.un("update", this.onUpdate, this);
+
+ /**
+ * @private
+ * Calls this.refresh if this.blockRefresh is not true
+ */
+ onDataChanged: function() {
+ if (this.blockRefresh !== true) {
+ this.refresh.apply(this, arguments);
+ }
+ },
if(this.onItemClick(item, index, e) !== false){
this.fireEvent("click", this, index, item, e);
}
if(this.onItemClick(item, index, e) !== false){
this.fireEvent("click", this, index, item, e);
}
- var indexes = [], s = this.selected.elements;
- for(var i = 0, len = s.length; i < len; i++){
- indexes.push(s[i].viewIndex);
+ var indexes = [],
+ selected = this.selected.elements,
+ i = 0,
+ len = selected.length;
+
+ for(; i < len; i++){
+ indexes.push(selected[i].viewIndex);
- var r = [], s = this.selected.elements;
- for(var i = 0, len = s.length; i < len; i++){
- r[r.length] = this.store.getAt(s[i].viewIndex);
- }
- return r;
+ return this.getRecords(this.selected.elements);
* @return {Boolean} True if selected, else false
*/
isSelected : function(node){
* @return {Boolean} True if selected, else false
*/
isSelected : function(node){
- * @param {Array/HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node,
- * id of a template node or an array of any of those to select
+ * @param {Array/HTMLElement/String/Number/Ext.data.Record} nodeInfo An HTMLElement template node, index of a template node,
+ * id of a template node, record associated with a node or an array of any of those to select
* @param {Boolean} keepExisting (optional) true to keep existing selections
* @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent
*/
* @param {Boolean} keepExisting (optional) true to keep existing selections
* @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent
*/
- * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+ * @param {HTMLElement/String/Number/Ext.data.Record} nodeInfo An HTMLElement template node, index of a template node,
+ * the id of a template node or the record associated with the node.
return document.getElementById(nodeInfo);
}else if(Ext.isNumber(nodeInfo)){
return this.all.elements[nodeInfo];
return document.getElementById(nodeInfo);
}else if(Ext.isNumber(nodeInfo)){
return this.all.elements[nodeInfo];
* @return {Array} An array of nodes
*/
getNodes : function(start, end){
* @return {Array} An array of nodes
*/
getNodes : function(start, end){
- * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+ * @param {HTMLElement/String/Number/Record} nodeInfo An HTMLElement template node, index of a template node, the id of a template node
+ * or a record associated with a node.