Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    110
    Hello,
    I need some help how to write code for COMMAND mode subscription in Angular components. I have implemented MERGE subscription it's working fine. There is no issue on Angular service and components. Only issue on COMMAND mode subscription.

  2. #22

    Arrow

    Hello,

    You should install the listener onItemUpdate on your subscription object and then update, add or remove rows of your table component according to the values of the fields key and command.

    For example,

    Code:
    sub.addListener({
        onItemUpdate: function(update) {
            var cmd = update.getValue('command');
            var key = update.getValue('key');
            switch (cmd) {
            case 'UPDATE':
                // update row identified by key
                update.forEachChangedField(function(name, pos, value) {
                    // update field of the row
                });
                break;
            case 'ADD':
                // add a new row identified by key
                break;
            case 'DELETE':
                // delete the row identified by key
                break;
            }
        }
    });
    In the snippets above, you should replace the comments with Angular code.
    Unfortunately we are not Angular experts, so we cannot help with this last point, which depends on the specific Angular widgets you want to use.
    Last edited by Alessandro Carioni; July 16th, 2020 at 08:21 AM.

  3. #23
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    110
    Hello,
    Is there a way subscription update after dynamically binding rows using MERGE subscription. For example I have 4 rows of data to show the stock market rate, admin having option to change the given set of data-item on that time ajax method used to update the table and dynamically recreate the subscribed items. Now I need to update subscription after alter the table row using ajax. Is this possible?

  4. #24
    I’m sorry, but it is not possible to change the items bound to a Subscription object while the subscription is active.
    You should unsubscribe from the old items and subscribes to the new ones.

 

 

Similar Threads

  1. implementation of lightstreamer for a quiz contest
    By Sameer Mhatre in forum Adapter SDKs
    Replies: 1
    Last Post: July 10th, 2013, 09:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 03:03 AM.