Skip to content
Wasif Hasan Baig edited this page Jan 17, 2015 · 7 revisions

change(event, data)

Triggered when the listview comes out of the Edit mode.

  • event: Event

    The original event object.

  • data: Object

    The data object associated with this event and contains the following information.

    { 
      /* All the items in the list
       * 
       * Array of Strings when "data-item-name"
       * is not specified for simple type
       * 
       * Array of Objects in case of complex type
       * and when "data-item-name" is specified for
       * the simple type
       */
      items: ["Apple", "Banana", "Orange", "Mango"],
      
      /* Only item(s) inserted in the current edit session
       * 
       * Array of Strings when "data-item-name"
       * is not specified for simple type
       * 
       * Array of Objects in case of complex type
       * and when "data-item-name" is specified for
       * the simple type
       */
      added: ["Orange", "Mango"],
      
      /* Size of the list */
      length: 4
    }

Remember "event name is the lowercase concatenation of the widget name and type" as documented here. So the event name in this case would be "listviewchange" unless you specify a different namespace using $.mobile.ns.

Clone this wiki locally