Dynamically show different “tap-to-execute” actions with swipe actions (RadListView)












0















The Telerik Progress UI documentation for RadListView swipe actions shows how to implement static "tap-to-execute" actions (RadListView - Swipe Actions), but is there a way to dynamically change, let's say the left-side action, based on some sort of outside data or the list item that is being swiped?



For Example in the IOS mail app, if a message is marked as Unread and you swipe right, the left-side action shows the option to mark it as "Read". And alternatively, if a message is marked as Read and you swipe right, the left-side actions shows the option it as "Unread". The action is determined by the list view item itself.



Is this possible with RadListView Swipe Actions?










share|improve this question



























    0















    The Telerik Progress UI documentation for RadListView swipe actions shows how to implement static "tap-to-execute" actions (RadListView - Swipe Actions), but is there a way to dynamically change, let's say the left-side action, based on some sort of outside data or the list item that is being swiped?



    For Example in the IOS mail app, if a message is marked as Unread and you swipe right, the left-side action shows the option to mark it as "Read". And alternatively, if a message is marked as Read and you swipe right, the left-side actions shows the option it as "Unread". The action is determined by the list view item itself.



    Is this possible with RadListView Swipe Actions?










    share|improve this question

























      0












      0








      0








      The Telerik Progress UI documentation for RadListView swipe actions shows how to implement static "tap-to-execute" actions (RadListView - Swipe Actions), but is there a way to dynamically change, let's say the left-side action, based on some sort of outside data or the list item that is being swiped?



      For Example in the IOS mail app, if a message is marked as Unread and you swipe right, the left-side action shows the option to mark it as "Read". And alternatively, if a message is marked as Read and you swipe right, the left-side actions shows the option it as "Unread". The action is determined by the list view item itself.



      Is this possible with RadListView Swipe Actions?










      share|improve this question














      The Telerik Progress UI documentation for RadListView swipe actions shows how to implement static "tap-to-execute" actions (RadListView - Swipe Actions), but is there a way to dynamically change, let's say the left-side action, based on some sort of outside data or the list item that is being swiped?



      For Example in the IOS mail app, if a message is marked as Unread and you swipe right, the left-side action shows the option to mark it as "Read". And alternatively, if a message is marked as Read and you swipe right, the left-side actions shows the option it as "Unread". The action is determined by the list view item itself.



      Is this possible with RadListView Swipe Actions?







      angular telerik nativescript swipe radlistview






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 26 '18 at 8:13









      phillipintxphillipintx

      52




      52
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Yes, You could do that. Use the itemSwipeProgressStarted event in which you will have access to both the current list item that's being swiped and swipeView. Based on the data, you could modify components inside your swipe view, get them by id and play with visibility to show / hide items and set swipe limits based on current measurements.






          share|improve this answer
























          • Could give an example? All of my efforts have proven unsuccessful

            – phillipintx
            Nov 26 '18 at 9:12











          • Do you have a Playground of what exactly you tried, may be I can fix that for you.

            – Manoj
            Nov 26 '18 at 9:15











          • here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

            – phillipintx
            Nov 27 '18 at 6:15











          • Here you go, updated your sample to show Read / Unread action based on the if condition.

            – Manoj
            Nov 27 '18 at 13:36













          • This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

            – phillipintx
            Nov 27 '18 at 22:24













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53476979%2fdynamically-show-different-tap-to-execute-actions-with-swipe-actions-radlistv%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Yes, You could do that. Use the itemSwipeProgressStarted event in which you will have access to both the current list item that's being swiped and swipeView. Based on the data, you could modify components inside your swipe view, get them by id and play with visibility to show / hide items and set swipe limits based on current measurements.






          share|improve this answer
























          • Could give an example? All of my efforts have proven unsuccessful

            – phillipintx
            Nov 26 '18 at 9:12











          • Do you have a Playground of what exactly you tried, may be I can fix that for you.

            – Manoj
            Nov 26 '18 at 9:15











          • here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

            – phillipintx
            Nov 27 '18 at 6:15











          • Here you go, updated your sample to show Read / Unread action based on the if condition.

            – Manoj
            Nov 27 '18 at 13:36













          • This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

            – phillipintx
            Nov 27 '18 at 22:24


















          0














          Yes, You could do that. Use the itemSwipeProgressStarted event in which you will have access to both the current list item that's being swiped and swipeView. Based on the data, you could modify components inside your swipe view, get them by id and play with visibility to show / hide items and set swipe limits based on current measurements.






          share|improve this answer
























          • Could give an example? All of my efforts have proven unsuccessful

            – phillipintx
            Nov 26 '18 at 9:12











          • Do you have a Playground of what exactly you tried, may be I can fix that for you.

            – Manoj
            Nov 26 '18 at 9:15











          • here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

            – phillipintx
            Nov 27 '18 at 6:15











          • Here you go, updated your sample to show Read / Unread action based on the if condition.

            – Manoj
            Nov 27 '18 at 13:36













          • This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

            – phillipintx
            Nov 27 '18 at 22:24
















          0












          0








          0







          Yes, You could do that. Use the itemSwipeProgressStarted event in which you will have access to both the current list item that's being swiped and swipeView. Based on the data, you could modify components inside your swipe view, get them by id and play with visibility to show / hide items and set swipe limits based on current measurements.






          share|improve this answer













          Yes, You could do that. Use the itemSwipeProgressStarted event in which you will have access to both the current list item that's being swiped and swipeView. Based on the data, you could modify components inside your swipe view, get them by id and play with visibility to show / hide items and set swipe limits based on current measurements.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 26 '18 at 8:40









          ManojManoj

          5,9532922




          5,9532922













          • Could give an example? All of my efforts have proven unsuccessful

            – phillipintx
            Nov 26 '18 at 9:12











          • Do you have a Playground of what exactly you tried, may be I can fix that for you.

            – Manoj
            Nov 26 '18 at 9:15











          • here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

            – phillipintx
            Nov 27 '18 at 6:15











          • Here you go, updated your sample to show Read / Unread action based on the if condition.

            – Manoj
            Nov 27 '18 at 13:36













          • This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

            – phillipintx
            Nov 27 '18 at 22:24





















          • Could give an example? All of my efforts have proven unsuccessful

            – phillipintx
            Nov 26 '18 at 9:12











          • Do you have a Playground of what exactly you tried, may be I can fix that for you.

            – Manoj
            Nov 26 '18 at 9:15











          • here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

            – phillipintx
            Nov 27 '18 at 6:15











          • Here you go, updated your sample to show Read / Unread action based on the if condition.

            – Manoj
            Nov 27 '18 at 13:36













          • This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

            – phillipintx
            Nov 27 '18 at 22:24



















          Could give an example? All of my efforts have proven unsuccessful

          – phillipintx
          Nov 26 '18 at 9:12





          Could give an example? All of my efforts have proven unsuccessful

          – phillipintx
          Nov 26 '18 at 9:12













          Do you have a Playground of what exactly you tried, may be I can fix that for you.

          – Manoj
          Nov 26 '18 at 9:15





          Do you have a Playground of what exactly you tried, may be I can fix that for you.

          – Manoj
          Nov 26 '18 at 9:15













          here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

          – phillipintx
          Nov 27 '18 at 6:15





          here is a quick thing I threw together play.nativescript.org/?template=play-ng&id=e6FP8n&v=2

          – phillipintx
          Nov 27 '18 at 6:15













          Here you go, updated your sample to show Read / Unread action based on the if condition.

          – Manoj
          Nov 27 '18 at 13:36







          Here you go, updated your sample to show Read / Unread action based on the if condition.

          – Manoj
          Nov 27 '18 at 13:36















          This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

          – phillipintx
          Nov 27 '18 at 22:24







          This is very close if you could help me with one more thing... while it does show the different "left item" based on the message property, it only calls the tap action on the mark-read-view View. And after tapping Read on the first item, it does not change to Unread the second time. It should allow me to toggle back and forth between read and unread. Thanks again for all your help on this

          – phillipintx
          Nov 27 '18 at 22:24






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53476979%2fdynamically-show-different-tap-to-execute-actions-with-swipe-actions-radlistv%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)