1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    163
    Vote Rating
    1
    extremed is on a distinguished road

      0  

    Default highlight the newly inserted row

    highlight the newly inserted row


    Hi

    Any idea how to highlight newly inserted row?

    i tried to use store's add event and it gives me the record and record index which last inserted.

    but how can i reference it to highlight the grid row?


    Regards

  2. #2
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,713
    Vote Rating
    104
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Use 'getNode' on the view:

    Code:
    var domNode = grid.getView().getNode(newRecord);
    Ext.get(domNode).highlight();

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    163
    Vote Rating
    1
    extremed is on a distinguished road

      0  

    Default


    Thanks a lot for the answer

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,800
    Vote Rating
    167
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    I'm having trbl with this one. I'm using the following code:
    Code:
    Ext.get(grid.getView().getNode(0)).highlight()
    If I console.log() the node it shows up correctly. Doing getView().focusRow(i) works as well.

    When I do the highlight operation multiple times in a row and console.log the node I can see that it's getting styling applied to it, but am not seeing the color change on the grid row. I turned stripeRows to false just to see if that was interfering with the highlight action. I tried frame() as well with no success.

    Tried in FF5 and IE8 with 4.0.7. Were you guys having any success with this code?

  5. #5
    Sencha User
    Join Date
    Feb 2008
    Posts
    23
    Vote Rating
    1
    Buzzwords is on a distinguished road

      0  

    Cool Similar frustrations.

    Similar frustrations.


    Through trial and error I've figured out how to highlight an updated grid row. In the grid's viewConfig I added a listener for the 'itemupdate' event, and simply highlighted the passed node.
    Code:
    viewConfig: {
            listeners: {
                itemupdate: function(record_updated, row_number, node, options) {
                    Ext.fly(node).highlight();
                }
            }
    }
    But when I tried the same for the 'itemadd' event it didn't apply the highlighting. No console errors, but no highlighting either. The 'itemadd' record and node arguments are arrays, so I'm iterating through the node array.
    Code:
    viewConfig: {
            listeners: {
                itemupdate: function(record_updated, row_number, node, options) {
                    Ext.fly(node).highlight();
                },
    // THIS DOESN"T WORK:
                itemadd: function(records_updated, row_number, nodes, options) {
                    Ext.Array.each(nodes, function(theNode) {
                        Ext.fly(theNode).highlight();
                    });
                }
            }
    }
    It would be great to get highlighting working in 'itemadd' the same way as in 'itemupdate'. Anybody have any ideas?

  6. #6
    Sencha User
    Join Date
    May 2011
    Posts
    75
    Vote Rating
    0
    saravanakmr is on a distinguished road

      0  

    Default


    Is possible for Editor grid?

    After complete the row entry.Can we highlight?








    Thanks

  7. #7
    Sencha User
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    7
    Vote Rating
    0
    puran4singh is on a distinguished road

      0  

    Default Proper event on view, when node get inserted. (need to add highlight logic)

    Proper event on view, when node get inserted. (need to add highlight logic)


    I am facing same kind of problem, unable to get an event on which i should add my code to highlight, which only fires when insertChild for node get invoked and I saw there is some replacement logic in onUpdate method of view, which removes the earlier node in dom so if you just add your code next to inserChild it just gives a blink, which is not intended.

    any help will be appreciated.