Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 2.54 KB

GKComponent-json-selectmenu.md

File metadata and controls

82 lines (55 loc) · 2.54 KB

json-selectmenu

json-selectmenu can render a select-menu widget by loading json data from backend service.

Properties

For any other properties, please refer to JQueryMobile's selectmenu Widget.

API

  • refresh

    If you set data to selectmenu via JavaScript , you must call the refresh method on it to update the visual styling.

    $('#selectmenu').gk().refresh();

  • model

    Set data to selectmenu , data type is JSON Array.

      var data = [
        {
            "text":"Annual Leave",
            "value":"V"
            },
            {
            "text":"Sick Leave",
            "value":"D"
            },
            {
            "text":"General Leave",
            "value":"E"
            },
            {"text":"Wedding Leave",
             "value":"W"
            }
        ];
        $('#selectmenu').gk().model(data);
        
      <select id="gk-57grpH" is="json-selectmenu" service="http://ezodemo.github.io/data/vacationTypes.json">
          <option value="{{value}}">{{text}}</option>
      </select>             

Javascript Code

Unlike most of our widgets generating tone of javascript code, this widget generates no code but html. All the javascript logic executes inside the component itself. This means you've no need to maintain those generated code any more, leave the code more clean and easy to maintain.


Above is the description of json-selectmenu. For more information, please back to GK-Components-List.

EZoApp Official Site: ezoui.com