I am trying to set a value to a combobox, and the code is as follows:
The problem i am getting it is that the value isn't getting set.
var t= Ext.ComponentQuery.query('#WindowID> #formId> #comboID')[0];
t.setValue('SOME v');
I also tried setText, there was no use.
If you want to set the value directly, try using
combo.setRawValue('SOME VALUE')
but be aware that this bypasses value conversion, change detection, and validation.
Visit http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-method-setRawValue
Related
I have tried setValue( Time ) which sets the display, but when we get this time then its returns 'null'("shiftTimearray.StartTime = null").
I'm using Ext.Version 4.2.1.
Here is my code where we are getting null even we have set Time in timefiled:
`shiftTimearray.StartTime = Ext.getCmp('startTime').getValue();
Without any further context/code, I can't reproduce your issue. Take a look at this Fiddle. Maybe you're not using the Date object as the value you're passing into setValue? According to the API, the value passed in must be an object, and looking at the source, the code checks to see if it's a date. Hope that helps.
I am using Extjs 3.4, I have a grid where I use editor function and form of NumberField type.
Here is my scenario, when the user starts editing a number field and immediately clears it and navigating to next page makes the field value set to '0' with dirty flag set which i dont want.
So, please help me out in having the control over the cell edited and also get the value i updated in the cells.
Thanks in advance,
RK
In ExtJs, when we defined a int field in the model.Its default value is taken as 0.We need to take help of useNull property in field with value as true:
{
name: <fieldName>,
type: 'int',
useNull: true
},
In NETSUITE
is there any way to access to a value inside of a combo-box at the item line level?
I need to access to a value after inserting an item but all functions get me null value.
I have tried
nlapiGetCurrentLineItemValue
and
nlapiGetFieldValue
Both functions are getting me null values.
Thanks,
Pablo.
In general (for user event and client script) below code should work
nlapiGetLineItemValue(LINE_ITEM_TYPE, YOUR_FIELD_ID, LINE_NUMBER);
eg on SO to get the line item Id:
nlapiGetLineItemValue('item', 'item', 1);
PS: Syntax is independent of data type or field type
If you mean combo box as a mulitselect, and if you're trying to access via User Event Script, use:
nlapiGetLineItemValues(type, fldname, linenum);
Note the 's' in nlapiGetLineItemValues
If its just a standard field, nlapiGetLineItemValue(type, fldname, linenum) should work.
Which call to use depends on what event you are capturing.
For instance if you are trying to access the value in a post sourcing, field changed or line validate event of a client script you would use nlapiGetCurrentLineItemValue('item', 'fieldname');
I have a wpf datagrid that I want to sort programatically as if the user had clicked on the header. After some searching I found reference to using this:
datagrid_selected.Items.SortDescriptions(2).Direction = ComponentModel.ListSortDirection.Ascending
Looks like it would work. Intellisense says Direction is a getter and setter, but when I try to assign it to something I get the "Expression is a value and therefor cannot be the target of an assignment" error. By nature as a setter I should be able to assign this to a value, right? Any idea what's going wrong?
It appears as if SortDescriptions are boxed values.
Instead, try the following.
var sortDescription = grid.Items.SortDescriptions[0];
sortDescription.Direction = System.ComponentModel.ListSortDirection.Ascending;
grid.Items.SortDescriptions[0] = sortDescription;
I have two dependent combo-boxes and the value of second one is populated after some value in the first has been selected.
For this, I am using setValue for the second combo-box at the select event of first one.
Below are the two cases of code, here case 1 doesn't work but case 2 works in IE9:
Case1: This doesn't work
select:function(combo, record){
Ext.getCmp('voyageMonitoritngVesselCode').store.load();//Loading the store of second combobox
Ext.getCmp('voyageMonitoritngVesselCode').setValue(record[0].data.vslCd);//Setting the value in the second combo-box
}
Case2: This works
select:function(combo, record){
Ext.getCmp('voyageMonitoritngVesselCode').store.load();//Loading the store of second combobox
alert(record[0].data.vslCd);//The only difference in both cases is this line
Ext.getCmp('voyageMonitoritngVesselCode').setValue(record[0].data.vslCd);//Setting the value in the second combo-box
}
That is, when I write an alert statment between loading of store and setting the value, then the values gets displayed in the second combobox, but if I omit this alert then there is no value set in the combobox.
I felt that probably the store needs time to load and it could be getting this time from the alert message halt. But as a solution for this, I used autoload:true for the second combo, so that the store doesn't have to be loaded but still the case was same - the value was not getting set without alert.
Could anyone please throw some light at this.
Browser - IE9
ExtJS - 4
Thanks in Advance.
The second doesn;t work because the load is an asynchron request meaning that the store is not loaded yet when you trie to set value, setting an alert before it gives it enough tme to load it ... a quick fix would be:
var combo = Ext.getCmp('voyageMonitoritngVesselCode');
combo.store.load({
callback:function(r, options, success) {
combo.setValue(record[0].data.vslCd);
}
});