<klip>
   <identity>
      <title>
         API: ListControl.onEndEdit()
      </title>
   </identity>
   <locations>
      <contentsource>
         http://support.klipfolio.com/files/demo/demo.xml
      </contentsource>
      <icon>
         http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
      </icon>
      <banner>
         http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png   
      </banner>
   </locations>
   <style>
      alert {
         type: item;
      }

      sender {
         itemcol: 2;
         noterow: 1;

         label: 'Sender';

         emphasis: strong;
      }


      summary {
         itemcol: 3;
         noterow: 4;

         wrap: false;

         notelabel: false;
      }

      date {
         itemcol: 4;
         noterow: 2;

         label: 'Date';
      }

      category {
         noterow: 3;

         label: 'Category';
      }


      level {
         itemcol: 1;
         noterow: 5;
         notelabel: false;
         
         type: image;
      }

      url {
         type: link;
      }
            
      id {
         key: override;
      }
   </style>
   <klipscript>
   <![CDATA[


var listControl;

function onLoad() {
 
     // Create a new tab
     var tab = Setup.addTab( "New Tab" );
 
     // Add a listcontrol usint the following parameters
     //
     //    true -- give each item in the list a checkbox
     //    true -- allow the user to select multiple items
     //
     listControl = tab.addListControl( true, true );
   
     // Set the list as editable
     listControl.editable = true;

     // Add three entries
     listControl.addItem( "First Item" );
     listControl.addItem( "Second Item" );
     listControl.addItem( "Third Item" );
     
     listControl.onEndEdit = listControl_onEndEdit;
}

function listControl_onEndEdit( index, text ) {
    trace( "You have edited item " + index + " from '" + this[index] + "' to '" + text + "'\r\n" );
    
    // Because we have defined an onEndEdit handler, the handler is responsible for
    // updating the text; otherwise, Klipfolio Dashboard will revert to original text.  
    
    this[index] = text;
}

function onRefresh()
{
	return Engines.Data.process( Prefs.contentsource );
}
  
   ]]>
   </klipscript>
</klip>
