1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    45
    Vote Rating
    0
    pajelawrence is on a distinguished road

      0  

    Default How to DataItem Id dynamically

    How to DataItem Id dynamically


    Hi,

    I have the same problem in DataItem. Moe specific I am using DataItem inside my DataView.
    The question is:
    1. How to set an Id on each DataItem?
    2. This ID's is dynamically from server.

    My idea is below.

    Code:
    config:{
    		cls: 'kitten-list-item',
    		action: 'freeStyleItem',
    		
    				
    		dataMap:{
    			setItemId: 'id', // This is What I mean. But it does not work, instead the ID was generated by the framework. "ext-layoutfreestyleitem-1"
    
    
    			getImage: {
    				setSrc: 'icon'
    			},
    			getName: {
    				setHtml: 'name'
    			}
    		},
    		image:true,
    		image:{
    			cls: 'x-img',
    			itemId: 'id'
    		},
    		name:{
    			cls: 'x-name',
    			flex: 1
    		}	
    	},
    Here is my JSON file

    Code:
    {
        "widgets": [
            {
                "order": 1,
                "id": "hey-297",
                "name": "Product and Services",
                "description": "Description soon!",
                "icon": "http://vegacrush.com/skyline/img/icongreen_badge.png",
                "edit": "arrow_right"
            },
            {
                "order": 2,
                "id": "296",
                "name": "Sencha touch",
                "description": "Description soon!",
                "icon": "http://skylinetest2.net/project2/assets/js/jquery/uploadify/features/1327899484-sub-icon-sencha-logo.jpg",
                "edit": "arrow_right"
            },
            {
                "order": 3,
                "id": "295",
                "name": "News Update",
                "description": "Description soon!",
                "icon": "http://skylinetest2.net/project2/assets/js/jquery/uploadify/upload/renz_logo.gif",
                "edit": "arrow_right"
            }
    ]
    }

    Please help me guys. Thank you in advanced

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Vote Rating
    756
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Why would you need to set the id or itemId? You can get the dataitem if you have the index of the record in the store.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar