Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country / States / City Dropdown... #7842

Open
crochefort opened this issue Jan 17, 2017 · 8 comments
Open

Country / States / City Dropdown... #7842

crochefort opened this issue Jan 17, 2017 · 8 comments

Comments

@crochefort
Copy link
Contributor

Just want to know how people are creating something similar as this...

http://demos.developerdesks.com/dropdown_select/

And how to better keep it up to date...

Some database( Maxmind ) are 33meg ... so quite big and this might not work with the new Canada.ca ... so just wondering how to acheive this for a form that might be migrated to canada.ca eventualy!

Thanks

@ghost
Copy link

ghost commented Jan 17, 2017

It would require JavaScript so you need to code a fall back when wbdisable is on or JS is turned off the user can still access the data (the example doesn't have a fall back).

@duboisp
Copy link
Member

duboisp commented Jan 17, 2017

@crochefort My PR #7790 will add a new plugin, named Fieldflow, that do it.

See the nesting working example: http://universallabs.org/wet/labs/wb-fieldflow/v0.2/wb-fieldflow.php#nesting

And it is designed in a way that it could be extended like you can add a custom srctype for the append action like:

$document.on( "CustomSrcType.draw.wb-fieldflow" , ".wb-fieldflow", function( event, data ) {
	if ( event.namespace === "draw.wb-fieldflow") {

		// ... Getting your datasource code here ..

		// ... Adapting the data to be passed to the next event ...

		// then trigger an event like: (see near line 1000 in the fieldflow source code for an example)
		$elm.trigger( renderas + "." + createCtrlEvent, {
			actions: actions,
			source: source,
			outputctnrid: data.outputctnrid,
			label: labelTxt,
			lblselector: labelSelector,
			defaultselectedlabel: data.defaultselectedlabel,
			required: !!!data.isoptional,
			items: $items,
			inline: data.inline
		} );
	}
} );

@TTVXStarWake
Copy link
Contributor

TTVXStarWake commented Jan 17, 2017

@crochefort What duboisp proposing is perfect for what your looking for. The new plug-in will take care of this issue. Can we close this issue ?

@duboisp
Copy link
Member

duboisp commented Jan 17, 2017

@MaximMartel I think we should wait until the PR #7790 with Fieldflow is merged. For now that feature is not part of WET.

@RobJohnston
Copy link
Contributor

Glad to see a WET solution! I had previously looked at the "Chained Selects Plugin for jQuery":

https://github.com/tuupola/jquery_chained

@crochefort
Copy link
Contributor Author

Thanks @duboisp for this ... the other question is ... more specific with canada.ca ...

Maybe @MaximMartel can answer it ... do you plan to have something built-in to get everything "the same" for the big site ... like a liste ... a Database ... I don't see why multiple instance should be created when you(PP) can probably create something that will handle this kind of information a 1 place and beeing accessible everywhere...

Just to make sure that it's all the same information ... like no spelling mistake in page A and page B display something else when they should have the same information(Country/States/City).

That might help the issue we discuss yesterday ;)

@TTVXStarWake
Copy link
Contributor

Agree @duboisp, we will keep that issue open until your PR will be merged in.

@TTVXStarWake
Copy link
Contributor

@crochefort Please forward your question related to canada.ca on GCweb :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants