1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    zirconias is on a distinguished road

      0  

    Default Unanswered: set fieldtext value from sent data

    Unanswered: set fieldtext value from sent data


    hi, here is my problem :
    i have a list of items in my navigationView, when "itemTap" i open a new panel where i need to display my Data.

    i can succesfuly retrieve my sent data when i use "tpl:{ticketID}

    but when i try to render the value on a textfield or label i can't, it render '{ticketID}' and not the value,

    here is my code :
    the controller :
    Code:
    Ext.define('selfCare.controller.caseDetails',{   extend:'Ext.app.Controller',
        requires:['selfCare.view.CaseDetail'],
        config:{
            refs:{
                casesContainer:'casesContainer'
            },
            control:{
                'casesContainer casesList':{
                    itemtap:function(list,index,target,record){
                       // console.log("ticket :"+ record.get('Ticketid'));
                        var detailsView=Ext.create('selfCare.view.CaseDetail');
                        detailsView.setData(record.getData());
                        this.getCasesContainer().push(detailsView);
                    }
                }
            }
    
    
        }
    });
    Code:
    Ext.define('selfCare.view.CaseDetail',{    extend:'Ext.Panel',
        xtype:'caseDetail',
    
    
        config:{
            title:'details',
            //layout:'fit',
            styleHtmlContent:true,
            scrollable:'vertical',
            styleHtmlCls:'caseDetail',
            tpl:'{Ticketid} {Nature}  ',
            items: [
                    {
                        xtype: 'fieldset',
                        //title: 'About You',
                        //instructions: 'Tell us all about yourself',
                        items: [
                            {
                                xtype: 'textfield',
                                readOnly: true,
                                name: 'Ticketid',
                                label: 'Ticket Id :'
                                //value: {Ticketid} // does not work
                            }
                        ]
                    }
                ]
    
    
        }
    });
    help me

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,682
    Vote Rating
    435
    Answers
    3111
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    That only works within a template. To do what you want you will need to execute setValue on that field.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    zirconias is on a distinguished road

      0  

    Default


    thank you for the answer, but i didnt get, how to use the setvalue in the "textfield" xtype,


    what i have is a data{} sent from the previous panel when i tap on a listitem, how could i bind the data on diferent "textfields" of the second view ?!

  4. #4
    Sencha User
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    9
    Vote Rating
    1
    SunilRao is on a distinguished road

      0  

    Default


    Hi,
    I'm new to sencha ,
    Even m havin the same problem. Can you please shoe how to use setValue() in form.
    Please!

  5. #5
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,384
    Vote Rating
    14
    Answers
    148
    AndreaCammarata will become famous soon enough AndreaCammarata will become famous soon enough

      0  

    Default


    Quote Originally Posted by SunilRao View Post
    Hi,
    I'm new to sencha ,
    Even m havin the same problem. Can you please shoe how to use setValue() in form.
    Please!
    If you have a data object

    Code:
    data: {
        name: 'Andrea',
        age: 29
    }
    then calling

    Code:
    myForm.setValues(data);
    ST will apply the values to the form fields which have the same "name" config param of your data.
    In this case, your form items should be:

    Code:
    {
        xtype: 'textfield',
        name: 'name'
    },
    {
       xtype: 'numberfield',
       name: 'age'
    }
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata


  6. #6
    Sencha User
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    9
    Vote Rating
    1
    SunilRao is on a distinguished road

      0  

    Default


    Quote Originally Posted by AndreaCammarata View Post
    If you have a data object

    Code:
    data: {
        name: 'Andrea',
        age: 29
    }
    then calling

    Code:
    myForm.setValues(data);
    ST will apply the values to the form fields which have the same "name" config param of your data.
    In this case, your form items should be:

    Code:
    {
        xtype: 'textfield',
        name: 'name'
    },
    {
       xtype: 'numberfield',
       name: 'age'
    }

    Thank a lot! Mr.Andrea,
    It really worked......