Recenter with minChars different from 2

View: New views
4 Messages — Rating Filter:   Alert me  

Recenter with minChars different from 2

by Vito Meuli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd like to set different minimum numbers of chars to trigger different
instances of the Recenter widget: sometimes I need only 1,  often 2 (default),
sometimes more then 2.
Is there a way of configuring it other then changing the code in DataField.js?
I'd like not to leave the trunk code.

Cheers,
Vito Meuli
_______________________________________________
Users mailing list
Users@...
http://www.mapfish.org/cgi-bin/mailman/listinfo/users

Re: Recenter with minChars different from 2

by Eric Lemoine-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 4, 2009 at 9:40 AM, Vito Meuli
<v.meuli@...> wrote:
> I'd like to set different minimum numbers of chars to trigger different
> instances of the Recenter widget: sometimes I need only 1,  often 2 (default),
> sometimes more then 2.
> Is there a way of configuring it other then changing the code in DataField.js?
> I'd like not to leave the trunk code.

Hi. There's currently no way to configure that, which sucks :-) A
patch introducing a minChars property or a comboOptions property or
both in the DataField class would be welcome.

Thanks,
--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine@...
http://www.camptocamp.com
_______________________________________________
Users mailing list
Users@...
http://www.mapfish.org/cgi-bin/mailman/listinfo/users

Re: Recenter with minChars different from 2

by Vito Meuli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This works fine for me.
I send you the patch and the whole new file.
It's my first patch, so please doble check it :-)

PS: I just downloaded the SVN trunk.

Cheers,
Vito

On Wednesday 04 November 2009 09:46:40 Eric Lemoine wrote:

> On Wed, Nov 4, 2009 at 9:40 AM, Vito Meuli
>
> <v.meuli@...> wrote:
> > I'd like to set different minimum numbers of chars to trigger different
> > instances of the Recenter widget: sometimes I need only 1,  often 2
> > (default), sometimes more then 2.
> > Is there a way of configuring it other then changing the code in
> > DataField.js? I'd like not to leave the trunk code.
>
> Hi. There's currently no way to configure that, which sucks :-) A
> patch introducing a minChars property or a comboOptions property or
> both in the DataField class would be welcome.
>
> Thanks,

[DataField.js.patch]

--- DataFieldORIGINALE.js 2009-09-25 10:07:30.000000000 +0200
+++ DataField.js 2009-11-04 10:10:08.000000000 +0100
@@ -85,6 +85,13 @@
     limit: 10,
 
     /**
+     * APIProperty: minChars
+     * {Number} An integer specifying the minimum number of chars the
+     *     combobox should wait the user to type before triggering the search.
+     */
+    minChars: 2,
+    
+    /**
      * APIProperty: fieldLabel
      * {String} The label used in front of the combo box, defaults to
      *     null.
@@ -124,7 +131,7 @@
             fieldLabel: this.fieldLabel,
             name: this.displayField,
             mode: 'remote',
-            minChars: 2,
+            minChars: this.minChars,
             typeAhead: true,
             forceSelection: true,
             hideTrigger: true,



_______________________________________________
Users mailing list
Users@...
http://www.mapfish.org/cgi-bin/mailman/listinfo/users

DataField.js (6K) Download Attachment

Re: Recenter with minChars different from 2

by Eric Lemoine-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 4, 2009 at 10:33 AM, Vito Meuli
<v.meuli@...> wrote:
> This works fine for me.
> I send you the patch and the whole new file.
> It's my first patch, so please doble check it :-)
>
> PS: I just downloaded the SVN trunk.

I added a test, and committed the patch to the trunk.
<http://trac.mapfish.org/trac/mapfish/changeset/3215>

Thanks for your contribution,


--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine@...
http://www.camptocamp.com
_______________________________________________
Users mailing list
Users@...
http://www.mapfish.org/cgi-bin/mailman/listinfo/users