1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    25
    Vote Rating
    0
    Answers
    2
    tmchedlishvili is on a distinguished road

      0  

    Default Answered: load some,distinct data from store in view.View

    Answered: load some,distinct data from store in view.View


    hello
    i'm interesting in possibility of loading some,distinct data from store in View.view
    i want
    Code:
    		var tpl = new Ext.XTemplate(			'<font size="5">Title</font> ',
    			   '<tpl for=".">',
    			      '<div style="margin-bottom: 20px;" class="valuer">',
        		       '<p/> some text <span>{#}.{templateId}',
    			      '</div>', 
    			    '</tpl>');
    					me.tpl = tpl;
    					},
    this load all data templateId and how i can load only one for example where templateId=1 ,how can i do this with Proxy?..

  2. i do it my self
    Code:
            var tpl = new Ext.XTemplate(
                      '<p>title: &nbsp; </p>',
                    '<tpl for=".">',
                   
                        '<tpl if="this.funct(templateId)">',
                        <p> {templateId}
                        
                                     '</tpl>',
                    '</tpl>',
                    {
                        // XTemplate configuration:
                        disableFormats: true,
                        // member functions:
                        funct: function(templateId){
                           return templateId == "8";
                        }
                       
                    }
                );

  3. #2
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,083
    Vote Rating
    44
    Answers
    24
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default


    So I'm assuming you want to only load one record into the dataview?
    Teahouse Training Company
    Official Certified Sencha Trainer

    Australia / New Zealand / Singapore / Hong Kong & APAC



    SenchaWorld.com - Sencha webinars, videos, etc
    SenchaForge.org - (coming soon)
    TeahouseHQ.com - Sencha ecosystem training portal

    Code Validation : JSLint | JSONLint | JSONPLint

  4. #3
    Sencha User
    Join Date
    Jun 2013
    Posts
    25
    Vote Rating
    0
    Answers
    2
    tmchedlishvili is on a distinguished road

      0  

    Default


    yes in my database is many data and it loads all records
    Code:
    1.31
    2.12
    3.48
    .....
    
    and my goal is load only one for example 31

  5. #4
    Sencha User
    Join Date
    Jun 2013
    Posts
    25
    Vote Rating
    0
    Answers
    2
    tmchedlishvili is on a distinguished road

      0  

    Default


    i do it my self
    Code:
            var tpl = new Ext.XTemplate(
                      '<p>title: &nbsp; </p>',
                    '<tpl for=".">',
                   
                        '<tpl if="this.funct(templateId)">',
                        <p> {templateId}
                        
                                     '</tpl>',
                    '</tpl>',
                    {
                        // XTemplate configuration:
                        disableFormats: true,
                        // member functions:
                        funct: function(templateId){
                           return templateId == "8";
                        }
                       
                    }
                );

Thread Participants: 1

Tags for this Thread