scriptfans / st-slidetoremove-plugin

Slide to Remove Plugin for Sencha Touch Lists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

st-slidetoremove-plugin

Slide to Remove Plugin for Sencha Touch Lists

SlideToRemove is a simple plugin for Sencha Touch 2 that adds the ability to swipe list items to remove them upon confirmation, very similiar to the native iOS controls seen on iPhones/iPads.

Currently supports Sencha Touch 2.1 & 2.2
Make sure you use the file for the correct version until they can be combined!

Usage Notes:

  1. Add this plugin to any list.
  2. User can now swipe the list item to display delete button, and swipe it back to hide the delete button. Multiple delete buttons can be open at one time.
  3. Set removeText in plugin configuration to change text on the delete button, and buttonWidth to change the width of the button.
  4. Easily change the button configuration manually in this plugin for advanced customization.
  5. By default the handler for the button will remove the record from the store.
  6. The closeDeletes method will close all open delete buttons.

2.4 Version Adds more customization, only tested with Sencha 2.4
You can specify:
*btnUI
*btnIcon
*hideDeletesOnTap (iOS like list functionality)
*itemTapFn (used in conjuntion with hideDeltesOnTap)

Usage Example:

Ext.create('Ext.List', {
    store: 'Bookmarks',
    plugins: {
        xclass: 'Ext.plugin.SlideToRemove',
        buttonWidth: '40%',
        removeText: 'Remove'
    },
    itemTpl: new Ext.XTemplate(
        '{Title}'
    )
});

About

Slide to Remove Plugin for Sencha Touch Lists