Results 1 to 2 of 2

Thread: Extjs 4.2.3 Combobox getInnerTpl Model and HasOne Association

  1. #1

    Default Extjs 4.2.3 Combobox getInnerTpl Model and HasOne Association

    Hi,
    im trying to implement an autocomplete functionality with combo

    my model looks like this

    Code:
    Ext.define('WSAVL.model.MapQuery', {
        extend: 'Ext.data.Model',
        fields: [],
        hasOne: [
            {
                name: 'geometry',
                model: 'Geometry',
                associationKey: 'geometry' // <- this is the same as what is in the JSON response
            },
            {
                name: 'attribute',
                model: 'Attribute',
                associationKey: 'attribute' // <- this is the same as what is in the JSON response
            },
    
        ]
    });
    associated models look like this


    Attribute:
    Code:
    Ext.define('WSAVL.model.Attribute', {     extend: 'Ext.data.Model',     fields: ['OBJECTID', 'Name', 'Type'] });
    Geometry
    Code:
    Ext.define('WSAVL.model.Geometry', {     extend: 'Ext.data.Model',     fields: ['x', 'y'] });
    My Data Looks Like this
    Code:
    {     "displayFieldName": "Name",     "fieldAliases": {         "OBJECTID": "OBJECTID",         "Name": "Name",         "Type": "Type"     },     "geometryType": "esriGeometryPoint",     "spatialReference": {         "wkid": 32638     },     "fields": [         {             "name": "OBJECTID",             "type": "esriFieldTypeOID",             "alias": "OBJECTID"         },         {             "name": "Name",             "type": "esriFieldTypeString",             "alias": "Name",             "length": 100         },         {             "name": "Type",             "type": "esriFieldTypeString",             "alias": "Type",             "length": 50         }     ],     "features": [         {             "attributes": {                 "OBJECTID": 19067162,                 "Name": "XX-0010",                 "Type": "House"             },             "geometry": {                 "x": 000000.75,                 "y": 000000.25             }         }     ] }
    my combobox getInnerTpl method looks like this

    Code:
    getInnerTpl: function() {     return '<h3><span>{attributes.Name}</h3>' }
    but it is displaying the empty list
    thank you for any help or suggestions

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Quote Originally Posted by nelzaatari View Post
    Code:
    getInnerTpl: function() {     return '<h3><span>{attributes.Name}</h3>' }
    Probably not the issue, but are you missing a </span>?

    Are you getting any messages or errors in console?

Similar Threads

  1. hasOne association and the empty model
    By rob.pridham in forum Ext: Q&A
    Replies: 2
    Last Post: 24 Dec 2013, 10:03 AM
  2. Replies: 2
    Last Post: 5 Apr 2013, 5:22 AM
  3. Replies: 1
    Last Post: 4 Apr 2013, 1:12 PM
  4. Saving a model with a hasOne association
    By chinabuffet in forum Ext: Q&A
    Replies: 1
    Last Post: 7 Mar 2013, 10:40 PM
  5. Saving Model with hasOne association
    By dawicorti in forum Sencha Touch 2.x: Q&A
    Replies: 9
    Last Post: 4 Jun 2012, 5:32 AM

Tags for this Thread

Posting Permissions

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