1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    1
    Vote Rating
    0
    alcarx is on a distinguished road

      0  

    Default Cannot display 0 in grid

    Cannot display 0 in grid


    a column such as id, cannot display 0, but can display other numbers such as 1, 2

    don't know whether it is because
    in JSONDataModel.js, loadData, var val = node[fields[j]]|| ""
    ..


    I am not very familiar with javascript, thanks

    ..Solved this by using a custom renderer

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Here's a patch. Thanks for reporting it.

    Code:
    YAHOO.ext.grid.JSONDataModel.prototype.loadData = function(data, callback, keepExisting){
    	var idField = this.schema.id;
    	var fields = this.schema.fields;
    	var rowData = [];
    	try{
    	    var root = eval('data.' + this.schema.root);
    		for(var i = 0; i < root.length; i++){
    			var node = root[i];
    			var colData = [];
    			colData.node = node;
    			colData.id = (typeof node[idField] != 'undefined' && node[idField] !== '' ? node[idField] : String(i));
    			for(var j = 0; j < fields.length; j++) {
    			    var val = node[fields[j]];
    			    if(typeof val == 'undefined'){
    			        val = '';
    			    }
    	            if(this.preprocessors[j]){
    	                val = this.preprocessors[j](val);
    	            }
    	            colData.push(val);
    	        }
    	        rowData.push(colData);
    		}
    		if(keepExisting !== true){
    		  this.removeAll();
    		}
            this.addRows(rowData);
        	if(typeof callback == 'function'){
    	    	callback(this, true);
    	    }
        	this.fireLoadEvent();
    	}catch(e){
    		this.fireLoadException(e, null);
    		if(typeof callback == 'function'){
    	    	callback(this, false);
    	    }
    	}
    };

Similar Threads

  1. Unable to display json data in grid
    By mhuibers in forum Ext 1.x: Help & Discussion
    Replies: 38
    Last Post: 12 Mar 2009, 11:59 AM
  2. grid.view.focusCell() display bug
    By papasi in forum Ext 1.x: Bugs
    Replies: 3
    Last Post: 8 Mar 2007, 9:24 PM
  3. LayoutDialog + Grid + toolbar display bug?
    By seldon in forum Ext 1.x: Bugs
    Replies: 13
    Last Post: 14 Dec 2006, 2:23 AM
  4. grid toolbar display issues in IE
    By sjivan in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 4 Dec 2006, 10:16 PM
  5. problem with paged grid display
    By jbowman in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 27 Sep 2006, 5:07 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar