Results 1 to 2 of 2

Thread: Metadata for a selected cell.

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2007
    Posts
    129

    Default Metadata for a selected cell.

    Hi All,
    I have a grid with a context menu on a specific column.

    When I right-click a cell in that column, a context menu pops up, the user selects an option and an Ajax request is sent to the server. This works fine.

    Here is my problem. Once the user makes a selection from the context menu, I would like to change the font of the data in the cell, or maybe change the color. (without reloading the entire grid)

    I can see how this is done with a renderer by getting the metadata from the cell.

    I can not figure out how to call the renderer or to get the cell's metadata unless the data has been changed by the user or unless the grid has been reloaded.

    Maybe there is a better way to do this but calling the renderer makes sense if I can figure out how to do it without changing data. Or if I can just get the metadata for the selected cell.

    1a. How can I get hold of (and then modify) the metadata (the style) for a cell when that cell is selected.
    or
    1b. How can I call the renderer without a user changing data in the cell?
    2. Is there a better way to do this?


    Thanks,
    Scott

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    There are 2 methods.
    1. Add an extra field to your record that holds a 'changed' flag that is used by the renderer to render in a different color. The menu handler then only has to set the changed field in the current record.
    2. Modify the gridview cell directly. This is only a temporary change and it is lost when the grid data is modified (e.g. when reloaded, sorted or updated).
    Code:
    Ext.fly(grid.getView().getCell(row, col)).addClass('some-class');

Similar Threads

  1. EditorGrid Get Selected Cell columnIndex
    By christophe.bousquet in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 26 Feb 2009, 12:04 AM
  2. Lost grid's selected cell
    By YargicX in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 8 Oct 2008, 4:08 AM
  3. Getting the contents of a selected cell
    By ajones86 in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 23 Jan 2008, 3:44 PM
  4. How can i get the selected cell value in the grid?
    By mingwong00 in forum Ext 1.x: Help & Discussion
    Replies: 40
    Last Post: 17 Oct 2007, 11:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •