-
3 Sep 2010 7:26 AM #1
Setting Value into combobox on screen load
Setting Value into combobox on screen load
Hi...
I have a combo ,templateName .I would like to initialize its value on screen load.
We tried the script below.But its showing script error.(this.el.dom is null or not an object)
Any help??
var templateName = new Ext.form.ComboBox({
id:'templateName',
fieldLabel : 'Template Code',
width : 130,
store:templateStore,
editable: false,
displayField : 'templateCode',
msgTarget:'side',
typeAhead : true,
allowBlank : true,
valueField:'templateId',
mode : 'local',
triggerAction : 'all',
emptyText : 'Please Select...'
});
if(templateName1 != null){
templateName.setValue(templateName1);
templateName.setRawValue(templateId1);
}
-
3 Sep 2010 8:56 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
You can't call setRawValue on an unrendered combobox.
You should be using the 'value' and 'hiddenValue' config options instead.
-
5 Sep 2010 9:50 PM #3
could you give me the script.
Actually my requirement is to set the template name & Id value into the combo after submitting the form value to the server.
The below script is not working
templateName.value=templateName1;
templateName.hiddenValue=templateId1;
-
5 Sep 2010 10:31 PM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Code:if (templateName.rendered) { templateName.setValue(templateId1); templateName.setRawValue(templateName1); } else { templateName.hiddenValue = templateId1; templateName.value = templateName1; }
-
7 Sep 2010 9:02 PM #5
templateName.setValue(val);
Here val is the value from templateStore that you have to set in combo.
-
7 Sep 2010 9:12 PM #6
Similar Threads
-
Need help with setting parameter for comboBox load
By catacaustic in forum Ext GWT: Help & Discussion (1.x)Replies: 1Last Post: 14 May 2009, 3:36 PM -
Setting Combobox with form.load() ?
By Bucs in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 17 Apr 2009, 7:03 AM -
Setting Ext.Ajax.Request Loading Screen
By RyanZec in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 28 Oct 2008, 8:38 AM -
Combo Box Slowing down screen load
By nrajesh in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 6 Nov 2007, 10:14 AM -
Let Store.load wait for results, setting (ComboBox) display values in grid
By lvanderree in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 14 Oct 2007, 4:00 PM


Reply With Quote