member.forEach(function(element, index) {
str_asc_key = str_asc_key + element.internalKey + ";";
str_asc_txt = str_asc_txt + element.text + ";";
count = count + 1;
});
//Assign the member list from above to array variable
var str_asc_key_ary = str_asc_key.split(";");
var str_asc_txt_ary = str_asc_txt.split(";");
//Define string variables for descending order
var str_desc_key = "";
var str_desc_txt = "";
//Loop 2 to sort in descending order and assign to descending string variables
member.forEach(function(element, index) {
str_desc_key = str_desc_key + str_asc_key_ary[(count-1) - index] + ";"; //Last item first
str_desc_txt = str_desc_txt + str_asc_txt_ary[(count-1) - index] + ";"; //Last item first
});
//Assign descending strings to array variables
var str_desc_key_ary = str_desc_key.split(";");
var str_desc_txt_ary = str_desc_txt.split(";");
//Loop 3 to assign values to Lisbox and Dropdown
str_desc_key_ary.forEach(function(element, index) {
if(element != ""){
LISTBOX_2.addItem(element, str_desc_txt_ary[index]);
DROPDOWN_2.addItem(element, str_desc_txt_ary[index]);
}
});
//Define members
var member = DS_1.getMembers("0CALMONTH", 1000);
//define a counter to get number of items in a member list
var count = 0;
//define string variables for regular order
var str_asc_key = "";
var str_asc_txt = "";
//Loop 1 to get number of items and item list and assign them to string variables
member.forEach(function(element, index) {
str_asc_key = str_asc_key + element.internalKey + ";";
str_asc_txt = str_asc_txt + element.text + ";";
count = count + 1;
});
TXT_COUNTER.setText("Number of Members: " + count); //See the number of items
//Assign the member list from above to array variable
var str_asc_key_ary = str_asc_key.split(";");
var str_asc_txt_ary = str_asc_txt.split(";");
//Define string variables for descending order
var str_desc_key = "";
var str_desc_txt = "";
//Loop 2 to sort in descending order and assign to descending string variables
member.forEach(function(element, index) {
str_desc_key = str_desc_key + str_asc_key_ary[(count-1) - index] + ";"; //Last item first
str_desc_txt = str_desc_txt + str_asc_txt_ary[(count-1) - index] + ";"; //Last item first
});
//Assign descending strings to array variables
var str_desc_key_ary = str_desc_key.split(";");
var str_desc_txt_ary = str_desc_txt.split(";");
//Loop 3 to assign values to Lisbox and Dropdown
str_desc_key_ary.forEach(function(element, index) {
if(element != ""){
LISTBOX_2.addItem(element, str_desc_txt_ary[index]);
DROPDOWN_2.addItem(element, str_desc_txt_ary[index]);
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |