Results 1 to 3 of 3

Thread: how to refer all the records in dataview after click on one common button.

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    58

    Default how to refer all the records in dataview after click on one common button.

    1)I have dataview List of some record.
    2)In list i am displaying Item_name,item_no,Item_desc & 1 numberfield
    3)There is one toolbar at top of the list which is having button for add record to store.
    4)User will see the record in list & then he will add quanity for items that he is interested in nuberfield.
    5)Then after click on addtostore button i want to add all that record to the store which user is interested(means record that are having some value in numberfield)
    How can i specifiy id for each numberfield separatly because i am decalring numberfield once only in datacomponent of dataview list?(right now i have give id to the numberfield but it is taking reference of numberfield of Last record in dataview list i want to take reference of all numberfields & record.)
    And
    After click of common Add to store button how i will refer each record against each numberfield?


  2. #2
    Sencha User AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148

    Default

    I assume you are using List components to be able to show a number field for every item, correct?
    If so, could you please post the component code?
    You don't need to assign id to numberfields.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

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

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    58

    Default

    yes u r absolutly correct.

    this is my component code.PLZ gv m soln its very urgent.ur reply is very important for m.Thanx in advance.

    Code:
    var uuid_trans = '';
    Ext.define('Myapp.view.List.itemdetail', {
        extend: 'Ext.dataview.component.DataItem',
        xtype : 'detail',
    
    
        config: {
            
            layout: {
                type: 'hbox'
            },
            items: [
            
            
    
    
                    {
                        xtype: 'component',
                        
                            
                            flex: 1,
                            html: '',
                            styleHtmlCls: 'bodyTitleBlackNormalList',
                            styleHtmlContent: true,
                            itemId: 'Item_no'
                    
    
    
                    },
                
            
            {
                xtype: 'container',
                
                
                items: [
                
                {
                    xtype: 'container',
                    layout: 'hbox',
                    items: [
                        {
                            xtype: 'spacer',
                            disabled: true,
                            height: 20,
                            html: 'Item_name',
                            margin: 0,
                            padding: '0 0 0 0',
                            styleHtmlCls: 'bodyTitleBlackList',
                            styleHtmlContent: true,
                            width: 80
                        },
                        //Data item form store
                        {
                            xtype: 'component',
                            style: 'word-wrap:break-word;overflow: hidden;max-width: 800px;',
                            
                            flex: 1,
                            html: '',
                            styleHtmlCls: 'bodyTitleBlackNormalList',
                            styleHtmlContent: true,
                            itemId: 'Itemname'
                        },
                        
                        
                    ]
                },
                {
                    xtype: 'container',
                    layout: 'hbox',
                    items: [{
                            xtype: 'spacer',
                            disabled: true,
                            height: 20,
                            html: 'Item_desc',
                            margin: 0,
                            padding: '0 0 0 0',
                            styleHtmlCls: 'bodyTitleBlackList',
                            styleHtmlContent: true,
                            width: 80
                        },    
                    
    
                        
                        //Data item form store
                        {
                            xtype: 'component',
                            style: 'word-wrap:break-word;overflow: hidden;max-width: 800px;',
                            height: 30,
                            //width: 200,
                            flex: 1,
                            html: '',
                            styleHtmlCls: 'bodyTitleBlackNormalList',
                            styleHtmlContent: true,
                            itemId: 'ItemDesc'
                        },
                        
                    ]
                },
                
                
                
                            
                
                ]
            },
            {
                xtype: 'container',
                layout: 'vbox',
                right: '130px',
                height: 50,
                width: 100,
                //height: 55,
                align: 'center',
                items: [
                    
                    {
                        xtype: 'numberfield',
                        itemId: 'quantity',
                        lable: 'quantity',
                        
                        height: 50,
                        width: 90,
                        
                        styleHtmlCls: 'formbox',
                        styleHtmlContent: true,
                        id: '1'
                    },
                
                    
                
                ]
            },
            
                
            ],
          
            
        },
    
    
        
        
        beforeInitialize: function() {
            //console.log('In beforeinitialize ');
            // Shortcuts to product template elements
        
         
            this.Item_no= this.down('#Item_no');
            
            this.Itemname= this.down('#Itemname');
            
            this.ItemDesc= this.down('#ItemDesc');
            
            
        },
        updateRecord: function(record) {
            //console.log('In updateRecord ' + record.get('UUID_TRANS'));
            // Provide an implementation to update this container's child items
        this.Item_no.setHtml(record.get('ITEM_NO'));
           this.Itemname.setHtml(record.get('ITEM_NAME'));
            this.ItemDesc.setHtml(record.get('ITEM_DESC'));
        
            
            this.sendRecord = record;
        },
        
        
        
        
    });

Posting Permissions

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