Results 1 to 1 of 1

Thread: [SOLVED] question on factory function

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Vote Rating

    Default [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.

    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{
    		proxy: new{
    			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?

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

    I changed this line in the function


    baseParams: {Field1: '1', Field2: '2', Field3: '3'},
    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

Posting Permissions

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