PDA

View Full Version : dateField.disable() hides the object



Apeksha
14 Jan 2011, 12:54 AM
Hi,

Need an urgent help on this. The scenario is:
1. I am using a gridPanel. The column model has columns like dateField, combo etc.
2. I am using RowEditor to edit the data.
3. I insert a blank row to the store and call roweditor. The row editor opens. I select a value in a combo. Based on the value selected, the datefield is to be enabled or disabled. I select a value such that the datefield is disabled.
4. I click on update, by which the row gets added to the grid.
5. Now I add another row to that grid, by inserting blank data in the store. Row editor is opened.
6. Now, when i again select value in this row's combo in such a way that the date field should be disabled. But what happens is when i select value in combo, the date field instead of disabling, get hidden. The date object in that row goes invisible.
7. The disable function when called second time gives this issue. The problem is not only for form.DateField, but also for numberfield that i have in my grid.

Kindly help me in finding the solution. Let me know if i am going wrong anywhere.

Have attached my sample js code.


var fm = Ext.form;

var _settleDate = new fm.DateField({format:'m/d/y'});
var _tradeDate = new fm.DateField({format:'m/d/y'});


_addtransactionTypecombo = new Ext.form.ComboBox({
store:_addtransactionTypestore,
valueField:'TransactionTypeId',
displayField: 'TransactionTypeId',
lazyRender:true,
editable:false,
triggerAction: 'all',
resizable: true,
listClass: 'x-combo-list-small',
forceSelection: true,
onSelect: function(record){

//disable fields based on transaction types
var flag = checkForTransactionTypes(record.data.TransactionTypeId);

if(flag == true){ // for the selected transaction, trade date, settle date, price, fee and commission should be disabled and blank


_tradeDate.disable();
_settleDate.disable();
Ext.getCmp('qtyNr').setDisabled(true);
Ext.getCmp('price').setDisabled(true);
Ext.getCmp('addcommissionNr').setDisabled(true);
Ext.getCmp('addfeeNr').setDisabled(true);


}else{


_tradeDate.enable();
_settleDate.enable();
Ext.getCmp('qtyNr').setDisabled(false);
Ext.getCmp('price').setDisabled(false);
Ext.getCmp('addcommissionNr').setDisabled(false);
Ext.getCmp('addfeeNr').setDisabled(false);

}
//------

AndreaCammarata
14 Jan 2011, 12:58 AM
Hi,
This is not the right place where to post.
This is Sencha Touch forum, you should post in Ext Help forum.

Apeksha
14 Jan 2011, 1:07 AM
oh sorry.