Results 1 to 4 of 4

Thread: Dot notation in field

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Location
    Brasil
    Posts
    6

    Default Dot notation in field

    I'm working on a web project and I'm trying to use in my JsonStore fields with dot nottation to reference columns in my database. The problem is that data are not populated.
    Am I doing something wrong? If I replace dot by underline works.

    Following sources:

    Code:
    {
    	xtype : "grid",
    	viewConfig : {
    		forceFit : true
    	},
    	store : {
    		xtype : "jsonstore",
    		autoLoad : true,
    		remoteSort : true,
    		root : "records",
    		totalProperty : "count",
    		url : "store!load.action"
    		sortInfo : {
    			field : "to.nome",
    			direction : "asc"
    		},
    		idProperty : "to.id",
    		fields : [
    			{ name : "to.id", type : "int" },
    			{ name : "to.nome", type : "string" },
    			{ name : "to.descricao", type : "string" }
    		]
    	}),
    	colModel : new Ext.grid.ColumnModel([
    		{ header : "id", dataIndex : "to.id" },
    		{ header : "cpf", dataIndex : "to.nome" },
    		{ header : "descricao", dataIndex : "to.descricao" }
    	])
    }
    Response format:
    Code:
    {
    	count:4,
    	records:[
    		{'to.id':51,'to.nome':'Aulas de Ingls','to.descricao':undefined},
    		{'to.id':53,'to.nome':'Kit Espanhol','to.descricao':undefined}
    	]
    }

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    41

    Default

    +1 for this. Any news?

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    you have to extend jsonReader for this.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha User
    Join Date
    Dec 2009
    Location
    Brasil
    Posts
    6

    Default

    The correct

    Code:
    {
    	count:4,
    	records:[
    		{to:{id:51, nome:'nome', descricao:'descricao'}}
    	]
    }
    Everton Luiz Pascke
    Certifications: SCJP/SCWCD

Similar Threads

  1. Dot notation with Ext.form fields' name config option
    By ilker in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Apr 2010, 10:59 AM
  2. Grid: Scientific notation in column
    By randomuser01 in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 23 Dec 2008, 10:36 PM
  3. Nested JSON Array Notation Mapping
    By Chrissu in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 13 Aug 2008, 9:12 AM
  4. Grid fails with scientific notation
    By drujensen in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 12 Jun 2008, 4:39 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
  •