Results 1 to 2 of 2

Thread: Possible bug in Ext.View

  1. #1

    Default Possible bug in Ext.View

    I used the following code to create a View that I could update with JSON data.

    var Root =[
    		{name: 'refId', mapping: 'refId'},
    		{name: 'displayType', mapping: 'displayType'},
    		{name: 'systemName', mapping: 'systemName'},
    		{name: 'title', mapping: 'title'},
    		{name: 'parentKeyName', mapping: 'parentKeyName'},
    		{name: 'urlArgs', mapping: 'urlArgs'},
    		{name: 'cls', mapping: 'cls'}
    var sectionReader = new{
    	root: 'root',
    	id: 'refId'
    }, Root); 
    var sectionDS = new{
    	proxy: new,
    	reader: sectionReader
    var tplSection = new Ext.Template( '<div class="{cls}" id="{refId}" name="{systemName}" type="{displayType}" display="{title}" title=">>Load {title} Menu" key="{parentKeyName}" args="{urlArgs}">{title}</div>' );
    // initialize the Section View
    var sectionView = new Ext.View('myview', tplSection, 
    	store: sectionDS, 
    	singleSelect: true, 
    	selectedClass: 'list-row-selected', 
    	emptyText: 'Unable to load menu roots' 
    I was trying to update a Ext.View by manually reading JSON records into the view's store and refreshing the view using the following code.

    var records ={'root': someJSONData});, {add: true}, true);
    The code would execute but the view was never refreshed. After digging into the debug code, I found that the following existed at line 9079:

        refresh : function(){
            var t = this.tpl;
            var html = [];
            var records =;
            if(records.length < 1){
            for(var i = 0, len = records.length; i < len; i++){
                var data = this.prepareData(records[i].data, i, r);
                html[html.length] = tpl.apply(data);
            this.nodes = this.el.dom.childNodes;
    this.prepareData uses an argument r that doesn't appear to exist.

    tpl.apply(data) should either be this.tpl.apply(data) or t.apply(data)

    After making those changes, the view refreshed as expected.

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    New York, NY


    Thank you. I have made those changes.

    Btw, the store API does have some functions other than loadRecords (add, insert) that may be more appropriate. loadRecords may be a private function for the release.

Similar Threads

  1. ext.View and ext.JSONView
    By jon.whitcraft in forum Community Discussion
    Replies: 18
    Last Post: 19 Feb 2009, 1:58 AM
  2. Any simple example with Ext.view
    By galdaka in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Mar 2007, 6:43 AM
  3. View and JsonView UML
    By BernardChhun in forum Community Discussion
    Replies: 3
    Last Post: 10 Feb 2007, 9:13 AM
  4. Advice using View
    By ncubeait in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 9 Feb 2007, 4:35 AM
  5. View question...
    By zquirm in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 16 Dec 2006, 7:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts