How to add country flags icon in front of ion-select-option? - angular7

I'm creating Ionic 4 plus Angular app, in that i'm using ion-select dropdown for country.now i want to add country flags icons in front of country name.below code shows what i'm try.
<ion-select class="dropdownselection" placeholder="PROVINCIA" interface="popover">
<ion-select-option value="A Coruña">
<ion-icon src="/assets/icons/man.svg"></ion-icon> A Coruña
</ion-select-option>
<ion-select-option value="Álava">Álava</ion-select-option>
<ion-select-option value="Albacete">Albacete</ion-select-option>
<ion-select-option value="red">D</ion-select-option>
</ion-select>

I know in Ionic 3 there wasn't a a reliable way to add icons. I'm not sure about Ionic 4, but I use this plugin and its great.
Here is an example.
Another huge benefit of this plugin is you can search tons of data asynchronously.

Old, but if someone's needing, you can use country flag emoji's unicode (you can find a list here).
Make sure you're using UTF-8 as meta charset.
Then, copy/paste the emoji in, by example, an object (between quotes) :
Finally, use the property in your template {{ myObject.flagIcon }}.
Example from my app :

Related

iOS Swift autocomplete dropdown with also own keywords

I'm looking for a way to create a textfield with autocomplete and dropdown feature so that a user can also add a new keyword.
Similar to this JS-selector:
https://select2.github.io/examples.html#tags
The only difference is that my textfield should only accept one selection and no multiselect.
I've googled for open source or a payed widget for this, but mostly I found very old and not good looking stuff with Swift 1 and things like that.
So is there no fancy autocomplete-dropdown textfield which is simple to implement in my project?
Or is there a reason why there is so less stuff on a UI-object like the one I described?
There is no auto-complete widget, that I'm aware of at least.
But you can create your own:
pull the string from the input textfield.
compare it against an array of potential keywords
pull the range of the string, highlight the letters in the keywords
where the user completes without selecting a drop down, add keyword
Check this https://github.com/mnbayan/AutocompleteTextfieldSwift.
Really easy to use and implement. You just need to create the UITextField as this type and set the content to check.
I've written a simple auto-complete pop up view named SwiftAutoSuggestion
Add pod 'SwiftAutoSuggestion' in your pod file
Then, Run pod install.
More details an be found on the link.
And, just to add another stick onto the woodpile, I just released this (RVS_AutofillTextField).
It's a UITextField that has been extended to provide a "dropdown" table, that acts as an autocomplete source.

jquery mobile selectmenu-custom-filter special characters

I am testing a jquery mobile filterable costum select in my project http://www.promocaototal.pt/cidades1.php it's all working fine but the issue is that the cities names are in Portuguese and when applying the filter it does not recognize the special charactes returning an empty search for names like Águeda when typing Agueda. Can anyone one point me in the right direction please?
Thanks
The easiest way is to append data-filtertext="Agueda" to the Águeda option.

Can't get rid of "via" text for Twitter share button

I'm working in a Rails 3.1.8 app and I'm having a problem creating a Twitter share button that produces the text I want. Here is the erb code for the button:
Tweet
This button appears on a page that contains content produced by a particular user. Let's call the user "sam". The text this code produces to be shared on Twitter is:
[some_text] [url of current page] via #sam
I would like to remove the "via #sam", but I cannot figure out how. If I explicitly set data-via I can change the user that the "via" phrase refers to, but I cannot make it disappear.
This support page suggests that omitting the data-via tag should do the trick, but I have found that it does not.
I've searched around the app to try to find a place where this parameter is being set, but I haven't found anything. However, as I'm pretty green with Twitter stuff, I may not be searching for the right thing.
Thanks in advance for your help, and do let me know if I can provide additional info.
ADDENDUM: I've tried add setting data-via to various values, including false, "false", and "", as well as appending ?via= and analogous values to the share URL. Each of these attempts resulted in a bogus via phrase (e.g. "#false"), or a default to "#sam".
Maybe you have an old version of the Javascript being included or cached.
Taking examples from https://dev.twitter.com/docs/tweet-button works as expected when omitting the data-via attribute.
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Working example: http://jsbin.com/uxopur/2/

Auto Search functionality for Schools/Universities using Asp.Net MVC

I am building a website where the user should have the capability of adding their School/University. I have noticed in LinkedIn, when i tried to type in my school name , it showed up a auto search box with all the schools, beginning with the letter i typed. How can i achieve the same functionality?
Do they save all the Universities in their database ? Or is there any Open webservices i can use that will show all the Schools/Universities ?
Thanks !
This feature is called "Auto Complete" and the text boxes are enabled with that. These allow you to filter the data required according to the characters you type in.
Please see this post for auto-complete feature implemented using jQuery.
Razor: Auto-complete text box inside jqGrid, How to bind values?
The example shown in that page lists all from the database. However, as a next phase, you can as well extend this feature to look for a WCF exposed service for universe of schools/colleges.
FYI" "GetSkillNameAutocomplete" is a method in the controller that takes a string parameter as an input (the search string) and gets the value(s).
Hope this helps!

How to dynamically generate url for image map in Oracle ApEx?

The scenario:
I have an ApEx page which pulls a record from a table. The record contains an id, the name of the chart (actually a filename) and the code for an image map as an NVARCHAR2 column called image_map.
When I render the page I have an embedded HTML region which pulls the image in using the #WORKSPACE_IMAGES#&P19_IMAGE. substitution as the src for the image.
Each chart has hot spots (defined in the image_map html markup) which point to other charts on the same ApEx page. I need to embed the:
Application ID (like &APP_ID.)
Session (like &APP_SESSION.)
My problem:
When I try to load the &APP_ID as part of the source into the database it pre-parses it and plugs in the value for the ApEx development app (e.g. 4500) instead of the actual target application (118).
Any help would be greatly appreciated.
Not a lot of feedback - guess I'm doing something atypical?
In case someone else is trying to do this, the workaround I ended up using was to have a javascript run and replace some custom replacement flags in the urls. The script is embedded in the template of the page and assigns the APEX magic fields to local variables, e.g.:
var my_app_id = '&APP_ID';
Not pretty, but it works...
Ok - I think I've left this open long enough... In the event that anyone else is trying to (mis)use apex in a similar way, it seems like the "apex way" is to use dynamic actions (which seem stable from 4.1.x) and then you can do your dynamic replace from there rather than embedding js in the page(s) themselves.
This seems to be the most maintainable, so I'll mark this as the answer - but if someone else has a better idea, I'm open to education!
I found it difficult to set a dynamic URL on a link to another page - directly - attempting to include the full URL as an individual link target doesn't work, at least in my simplistic world, I'm not an expert (as AJ said: any wisdom appreciated).
Instead, I set individual components of the url via the link, and a 'Before Header' PL/SQL process on the targeted page to combine the elements into a full url and assign it to the full url page-item:
APEX_UTIL.set_session_state(
'PG_FULL_URL',
'http...'||
v('PG_URL_COMPONENT1')||
v('PG_URL_COMPONENT2')||
'..etc..'
);
...where PG_FULL_URL is an item of Type 'Display Image', 'Based On' 'Image URL stored in Page Item Value'.
This is Apex 5.1 btw, I don't know if some of these options are new in this release.

Resources