1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    566
    Vote Rating
    0
    moegal is on a distinguished road

      0  

    Default [SOLVED] question on factory function

    [SOLVED] question on factory function


    Can someone help?

    I have a function and I want to change the baseParams of the store without recreating the entire store if possible.

    Code:
    function createCombo(config) {
        return new Ext.form.ComboBox(Ext.apply({
        	id: 'mycombo',
    	fieldLabel: 'Locations',
    	displayField: 'name',
    	name: 'list_ids',
    	mode: 'local',
    	triggerAction: 'all',
    	store: new Ext.data.JsonStore({
    		proxy: new Ext.data.HttpProxy({
    			url: 'list.php',
    			method: 'post'
    		}),
    		autoLoad: true,
    		baseParams: {Field1: '1', Field2: '2', Field3: '3'},
    		fields: [{name: 'id'}, {name: 'name'}],
    		id: 'id',
    		root: 'Records'
    	})
       }, config));
    };
    I realize this will not work, but could use some help. How do I pass the new baseParams in the function?

    Code:
    createCombo({
    id: 'mynewcombo',
    baseParams: {Field1: '99', Field2: '100', Field3: '101'}
    })
    Thanks, Marty

    I changed this line in the function

    From:

    Code:
    baseParams: {Field1: '1', Field2: '2', Field3: '3'},
    To:
    Code:
    baseParams: config.baseParams || {Field1: '1', Field2: '2', Field3: '3'},
    Last edited by moegal; 11 Aug 2010 at 5:57 PM. Reason: Solved

Similar Threads

  1. CRUD Factory
    By mask_hot in forum Community Discussion
    Replies: 4
    Last Post: 4 Mar 2010, 2:05 AM
  2. Ajax.request factory
    By stricte in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 4 Jan 2010, 2:38 PM
  3. Factory design pattern problem
    By JoelCool in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 12 Oct 2009, 10:14 AM
  4. Factory Function File Pattern
    By jsakalos in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 19 Apr 2009, 7:01 AM
Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi