cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
249
Views
0
Helpful
1
Replies

UpdateCallVariablesSampleGadget

Bill Near
Level 1
Level 1

Hello.  I have installed the UpdateCallVariables Sample gadget in a test environment where I am not only using all 10 callVariables, but also several extended call context (ECC) variables.  I have adjusted the JavaScript code to exclude those variables that I don't need to display.

UpdateCallVariableData.png

Not pretending to be a JavaScript expert (not even close), my question is this:  Is there a simple code snippet that I can add to the gadget's JavaScript code to force those variables displayed to sort in alphabetical order?

I appreciate any response.

Thank you,

Bill Near

Logicalis US (Lansing, Michigan, USA)

1 Reply 1

dekwan
Cisco Employee
Cisco Employee

Hi Bill,

I am not sure if this is considered a simple code snippet, but the dialog.getMediaProperties() returns a map. So, what you would want to do is to sort the keys of the map, which are the call variable names first. Then, look through this sorted key list and retrieve the values for each of those variables while building the HTML.

See the following for an example on how to sort the keys and such: https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key

Thanx,

Denise

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: