PDA

View Full Version : how to pass form values from 2 forms as extraParams?



JohnJones357
27 Aug 2014, 5:35 AM
I have two forms whos values I want to pass as extraParams to my grid stores proxy, I just dont know the proper syntax


this.getMyGrid().getStore().getProxy().extraParams = this.getForm1().getValues();

how would i add this.getForm2().getValues() to the above code?
thx

Scott-1
27 Aug 2014, 6:16 AM
This is how I did it.

lStore.getProxy().extraParams = { };
lStore.currentPage = 1;
for (i = 0; i < lSearchCriteria.fields.keys.length; i++){
var lKey = lSearchCriteria.fields.keys[i];
if (lSearchCriteria.get(lKey) != '' && lSearchCriteria.get(lKey) != null){
hasSearchCirteria = true;
console.log('Searching On: ' + lKey +' = ' + lSearchCriteria.get(lKey) );
lStore.getProxy().setExtraParam( lKey, lSearchCriteria.get(lKey));
}
}

JohnJones357
28 Aug 2014, 7:51 AM
thanks for your response. I ended up using Ext.apply( ); instead.


Ext.apply(this.getMyGrid().getStore().getProxy().extraParams, this.getForm1().getValues(), this.getForm2().getValues());