سؤال

in webos applications like pod frenzy / dr podder, among others, list items are "swipe to delete," where you swipe to the right of the screen on a specific row, which drag's the row off the screen revealing a delete dialog, at which point, you can either respond to the delete dialog, or just swipe another row, which has the effect of selecting the "delete" option of the original row, while the dialog is now presented to you for the just swiped row.

how do i do that / did palm release example code that shows how that, or something similar is done?

هل كانت مفيدة؟

المحلول

In this link under List Manipulation it talks about it. The space revealed when you swipe to delete, which may contain confirmation buttons.

.palm-row.palm-swipe-delete

.palm-row.palm-swipe-delete 
.palm-swipe-delete-button

.palm-row.palm-swipe-delete 
.palm-swipe-undo-button

View this documentation for examples

نصائح أخرى

In enyo, you'll need to use the swipeableitem kind within your list. I'm assuming you're using a VirtualRepeater, but it works with other kinds of lists too.

...
{kind:enyo.VirtualRepeater, ... , components:[
    {kind:enyo.SwipeableItem, onConfirm:"deleteItem", components:[
        ...
    ]},
]},
...
deleteItem:function(inSender,inIndex)
{
    //delete item inIndex
},
...

Note that, within enyo, swiping an item while another item's delete prompt is showing causes it to cancel, not to confirm.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top