567d929f072b6e2a618882a0d8e55cbf354ff8a6
[framework/web/web-ui-fw.git] / demos / tizen-winsets / widgets / multibuttonentry-demo.js
1 ( function ( $, window ) {\r
2         $( document ).ready( function () {\r
3                 $( "#MBTaddItemTest" ).click( function () {\r
4                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", "additem" );\r
5                 });\r
6 \r
7                 $( "#MBTremoveItemTest" ).click( function () {\r
8                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove", 0 );\r
9                 });\r
10 \r
11                 $( "#MBTinputTextTest" ).click( function () {\r
12                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText", "Hello~~~" );\r
13                 });\r
14 \r
15                 $( "#MBTgetInputTextTest" ).click( function () {\r
16                         var input = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText" );\r
17                         window.alert( "input String : " + input );\r
18                 });\r
19 \r
20                 $( "#MBTremoveAllItemTest" ).click( function () {\r
21                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove" );\r
22                 });\r
23 \r
24                 $( "#MBTgetSelectedItemTest" ).click( function () {\r
25                         var content = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select" );\r
26                         window.alert( "Select content : " + content );\r
27                 });\r
28 \r
29                 $( "#MBTselectItemTest" ).click( function () {\r
30                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select", 0 );\r
31                 });\r
32 \r
33                 $( "#MBTlengthTest" ).click( function () {\r
34                         var length = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "length" );\r
35                         window.alert( "length : " + length );\r
36                 });\r
37 \r
38                 $( "#MBTfocusInTest" ).click( function () {\r
39                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusIn", 0 );\r
40                 });\r
41 \r
42                 $( "#MBTfocusOutTest" ).click( function () {\r
43                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusOut", 0 );\r
44                 });\r
45 \r
46                 $( "#MBTdestoryTest" ).click( function () {\r
47                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "destory" );\r
48                 });\r
49 \r
50                 $( "#contentList a" ).click( function () {\r
51                         var arg = $( this ).text();\r
52                         $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", arg );\r
53                 });\r
54 \r
55                 $( "#cancelBtn" ).click( function () {\r
56                         $.mobile.changePage( "#multibuttonentry", {\r
57                                 transition: "reverse slide",\r
58                                 reverse: false,\r
59                                 changeHash: false\r
60                         } );\r
61                 });\r
62         });\r
63 } ( jQuery, window ) );