Currently as I know, we can hard code the dropdown data using following method.
First dropdown "Department" is based on hard coded value using options
Second dropdown "Title" is based on some hard coded script value.
Sample Dropdown value
In most of the situation, customer data are always come from SQL table. How can we populate dropdown data from SQL table ?
Can anyone provide some example ?
Here is an example from orejo01
Very useful information, thanks Gil.
My SQL query is returning a SORTED result
But when display in form, it is not sorted...how can i fix this ?
is ok, i found a way to sort the result.
added ".sort()" on the variable success.returnValue
then dropdown result show -> sorted.
You can also do the sorting directly on the SQL level - let the DB to the hard work - they are optimized for this.
Sorting on the client (i.e. the browser) depending on the size of the array is less efficient.
SELECT * FROM Customers ORDER BY Country;
Based on my finding, the SQL query result is already sorted. When the result(array) pass into GUI, it is not sorted.
I manage to load "Country" value from a SQL table into a dropdown in Create New Employee form,
but for Modify Employee form, my Existing Employee Country's value is "Japan", when loaded Country into dropdown from SQL table, the existing country value is not selected.
How can I pre-select existing Country(that belong to existing Employee) value in dropdown ?