PDA

View Full Version : [CLOSED] DateField Spiner Plugin



softmachine2011
Aug 31, 2012, 8:04 AM
Hi,

In v1.x I have this markup code that works correctly.



<ext:DateField ID="dateField" runat="server" AllowBlank="false" Width="90">
<Plugins>
<ext:Spinner runat="server" TabIndex="403">
<listeners>
<SpinUp Handler="onSpinMovimientoFiltroFecha(1);" />
<SpinDown Handler="onSpinMovimientoFiltroFecha(-1);" />
</listeners>
</ext:Spinner>
</Plugins>
</ext:DateField>


Now, in v2.1, I can't perform it because doesn't appear like a plugin of datefield and it isn't recognized by compiler.

How I cando it now?

Daniil
Aug 31, 2012, 1:31 PM
Hi,

Unfortunately, this plugin has been removed. We will add a respective CHANGELOG item, thanks for the report.

But SpinnerField appeared.

We think that a simplest way to achieve your requirement would be using two fields - DateField and SpinnerField.

Place them each after another using HBoxLayout leaving spinners only for the SpinnerField. We think it should work.

softmachine2011
Sep 03, 2012, 6:52 AM
I understand what you say, but how can I hide field of spinnerfield to achieve the requirement?

Daniil
Sep 03, 2012, 7:33 AM
I would implement it this way.

Example

<ext:Container runat="server" Layout="HBoxLayout" Width="117">
<Items>
<ext:DateField runat="server" Width="100" HideTrigger="true" />
<ext:SpinnerField runat="server" Width="17" FieldCls="x-hidden" />
</Items>
</ext:Container>

softmachine2011
Sep 03, 2012, 8:23 AM
Good trick, I was looking for a property to hide field but I know that it would be strange.

Thanks it works as I expected.

But what's the difference between a container and a panel, as I can see container couldn't have border. Is it the difference?

WITH CONTAINER


<ext:Container runat="server" Layout="HBoxLayout" Width="117">
<Items>
<ext:DateField runat="server" Width="100" />
<ext:SpinnerField runat="server" Width="17" FieldCls="x-hidden" />
</Items>
</ext:Container>


NOTE: With border true it doesn't renders border.

WITH PANEL


<ext:Panel runat="server" Layout="HBoxLayout" Width="117" Border="false">
<Items>
<ext:DateField runat="server" Width="100" />
<ext:SpinnerField runat="server" Width="17" FieldCls="x-hidden" />
</Items>
</ext:Panel>

I don't need border, it is only for clarify controls usage.

Thanks again.

Daniil
Sep 03, 2012, 9:53 AM
Panel is a Container (in OOP terms). Container is a light-weight container. Panel has many addition functionality, for example, dockedItems (header, footer, etc.).

Here you can read more details.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.Container
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel

If you don't need Panel functionality, please use Container. It makes your application more light-weight, i.e. improve its performance.

softmachine2011
Sep 03, 2012, 9:57 AM
Ok thanks.