Results 1 to 6 of 6

Thread: How to Push lists to next view with selected items in Togglefield?

  1. #1
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default How to Push lists to next view with selected items in Togglefield?

    Requirement:
    I have a list with "Ext.dataview.component.DataItem", where i add togglefield before every list item.
    For what ever the items i select "togglefield", only those record should push to next push after a button press.

    Help me how to handle this.

    toggleviewList.png

    views:
    Main View
    Code:
    Ext.define("common.view.CancelTransferMobileStep1", {
        extend: 'Ext.Container',
        xtype: 'cancel-transfer-mobile-step1',
        config: {
            style: 'background-image: -webkit-linear-gradient(bottom, rgb(212,212,212) 60%, rgb(199,199,199) 80%);',
            layout: { type: 'vbox'},
    		height: '100%',
             items: [
    			{
    				xtype: 'panel',
    				layout: 'fit',
    				items:[
    					{
    						xtype: 'cancel-transfer-mobile-list',
    						
    					},
    				],
    				flex: 1
    			},
    			{
    				xtype:'panel',
    				layout:{type: 'hbox', pack: 'center'},
    				items:[
    					{
    						width: '191px',
    						height: '30px',
    						xtype: 'button',
    						style:'margin:10px',
    						text: 'Transfer',
    						id:'doCancelTransfer',
    					}
    				]
    				
    			}
    	
            ]
        }
    });
    DataView
    Code:
    Ext.define('Common.view.CancelMobileTransferList', {
    	extend: 'Ext.dataview.DataView',
    	xtype: 'cancel-transfer-mobile-list',
        alias : 'widget.mainPanel',
    	 config: {
            fullscreen: true,
    		height: '100%',
            defaultType: 'cancelMobileTransferListitem',
            store: 'CancelTransferMobileStore',
            useComponents: true,
    		emptyText: 'No Groups Found',
    		layout: 'vbox',
    		id:'navigationview',
            itemTpl: [
                '<div>Data View Item {string}</div>'
            ],
    		
        }
    
    
    });

    List Item
    Code:
    Ext.define('common.view.CancelMobileTransferListItem', {    extend: 'Ext.dataview.component.DataItem',
        alias: 'widget.cancelMobileTransferListitem',
    	id:'cmtlistItem',
        config: {
            padding: 10,
            layout: {
                type: 'hbox'
            },
            items: [
    			{
    				xtype: 'togglefield',
    				itemId: 'rememberUser',
    				id: 'rememberUser',
    				name: 'keepUser',
    				value: false
    			},
    			{
    			  xtype: 'container',
    			  defaults: {
    				xtype: 'component',
    				margin: '5 5 5 5',
    			  },
    				  items: [
    					   { html: 'transfer list data', itemId:'transferItem' }
    				  ]
    			}
               
                
            ]
        },
     
        updateRecord: function(record) {
            var me = this;
    	   me.down('#transferItem').setHtml('<div style="font-size:14px;"><div>Item Name:'+record.get('ItemName')+'</div>'+'<div>Item Number:'+record.get('ItemNumber')+'</div></div>');         
            me.callParent(arguments);
        }
    });


    Advance Thanks.

  2. #2
    Sencha Premium User
    Join Date
    May 2011
    Location
    Gainesville, FL
    Posts
    227
    Answers
    29

    Default

    Learn the API - this is a bad question to ask others because it's highly specific to your situation and dependent on a general understanding of the api. Use formpanel as the container and #getValues() - or - listen to the togglefield's change event, bubble up to the listitem - grabbing the record - and then add those to the store in the next step's list.

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    The way I would approach this would be in the change event handler I would update some field in the record. Then when the transfer button is tapped and you are going to go to the next view you just look for the records that have that field changed in that store and show them in the next list. Simple as that.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #4
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default Thank you mitchell!!

    let me try in this way.

    Thank you so much.

  5. #5
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default Thank you fischer, for quick suggestion.

    Thanks.

  6. #6
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default Dear Michell!!

    i am very much new to senchaTocuh.

    I tried in many ways, the way you suggested. If possible could you please share a small code snippet for my reference.



    Thanking you.

Posting Permissions

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