PDA

View Full Version : lost focus SpinnerField



ser
1 Dec 2010, 4:19 AM
I have a problem with SpinnerField. After setting value in the field, I click the mouse outside the control, but the input value is not happening. Need to conduct like a ComboBox. Why SpinnerField does not behave like a ComboBox with after loss of focus.

To illustrate it
http://www.youtube.com/watch?v=x9rM4pOYTT8

ser
3 Dec 2010, 6:26 AM
i guess nobody knows?

Condor
3 Dec 2010, 6:34 AM
Yes, SpinnerField focus handling isn't what it should be.

ps. What exactly is the problem (our company webfilter doesn't allow access to youtube)?

ser
3 Dec 2010, 1:37 PM
try this example, please.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="ext-3.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext-3.2.1/examples/ux/css/Spinner.css" />
<script type="text/javascript" src="ext-3.2.1/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="ext-3.2.1/ext-all-debug.js"></script>
<script type="text/javascript" src="ext-3.2.1/examples/ux/Spinner.js"></script>
<script type="text/javascript" src="ext-3.2.1/examples/ux/SpinnerField.js"></script>
</head>

<body>
<script type="text/javascript">
Ext.onReady(function(){
var simple = new Ext.FormPanel({
labelWidth: 40,
frame: true,
title: 'Simple Form',
bodyStyle: 'padding:5px 5px 0',
width: 450,
height: 300,
defaults: {width: 135},
defaultType: 'textfield',
items: [
{
xtype: 'editorgrid',
// hideHeaders: true,
height: 145,
width: 250,
columnLines: true,
store: new Ext.data.ArrayStore({
storeId: 'buygetList',
data: [{
name: 'sdf',
x1: 'sd',
x2: '4',
x3: '34'
}
],
fields: ['name','x1','x2','x3']
}),
cm: new Ext.grid.ColumnModel([{
header: "spinnerfield",
dataIndex: 'name',
sortable: true,
editor: new Ext.ux.form.SpinnerField({
fieldLabel: 'Age',
name: 'age'
})
},{
header: "combobox",
dataIndex: 'x1',
sortable: true,
editor: new Ext.form.ComboBox({
store: new Ext.data.ArrayStore({data: [['Company']],
fields: [
{name: 'company'}
]
}),
allowBlank: false
})
}
])
}
]
});

simple.render('form-ct');
});

</script>

</head>
<body>

<div id="form-ct" style="margin-top:1em"></div>

</body>
</html>


Double click on the cell ComboBox - it appeared, then single click on the form - combobox disappeared.
double click on the cell spinnerfield - it appeared, then single click on the form - spinnerfield NOT disappeared.

Why?

Condor
3 Dec 2010, 11:38 PM
SpnnerField needs to fire a proper blur event, which, unfortunately, it doesn't.

This is going to be difficult to implement (have a look at the TriggerField source code to see how that could be done).

ser
3 Dec 2010, 11:50 PM
OK. Thanks. I Will see....