# Ranking List

#### Ranking List 형 위젯은 플레이어의 랭킹을 정렬한 UI입니다.

활용 예 ) 달리기 공식 맵, 결투장 공식 맵, 승부 예측 앱, 포인트 앱

#### Image

![](/files/EzdV6GNBSJwXukICXuoY)

#### Example

{% file src="/files/nmg5sF3qrdFJUW6LVVxY" %}

```javascript
const dummyData = {
    'a': {
        id: 'a',
        name: 'user1',
        point: 100,
    },
    'b': {
        id: 'b',
        name: 'user2',
        point: 200,
    },
    'c': {
        id: 'c',
        name: 'user3',
        point: 400,
    },
    'd': {
        id: 'd',
        name: 'user4',
        point: 1000,
    },
    'e': {
        id: 'e',
        name: 'user5',
        point: 2000,
    },
    'f': {
        id: 'f',
        name: 'user6',
        point: 4000,
    },
};
function openWidget(p)
{
    //Check if player is mobile or not
    if (p.isMobile)
        //Set the widget's name, anchor position, width, and height.
        p.tag.widget = p.showWidget('widget.html', 'sidebar', 350, 480);
    else
        p.tag.widget = p.showWidget('widget.html', 'middle', 400, 448);
    
    //Send data to widget
    p.tag.widget.sendMessage({
        data: dummyData,
        id: p.id,
        isMobile: p.isMobile,
    });
    
    //Register events for messages sent from widgets
    p.tag.widget.onMessage.Add(function (sender, msg) {
        if (msg.type == "close") {
            if (sender.tag.widget) {
                sender.tag.widget.destroy();
                sender.tag.widget = null;
            }
        }
    });
}

//Event when a player joins the app
App.onJoinPlayer.Add(function(p) {
    //Reset the player's tag value
    p.tag = {};
});

// Action when the player clicks the sidebar app
App.onSidebarTouched.Add(function(p) {
    openWidget(p);
});


```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-kr.zep.us/creator/tutor/undefined/ranking-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
