Results 1 to 7 of 7

Thread: How to hide column

  1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    177

    Question How to hide column

    Hello,

    I have a grid with hidden column id.

    I hide the id column with
    {header: "id", hidden:true, ...
    But web user can view the column form grid sort& show hide column menu.
    Is there a way of preventing this, or any suggestions?

    Thanks.
    --
    Mehmet ad?rc?

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Location
    Colorado
    Posts
    51

    Default

    Why are you adding the column to the column model?

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    177

    Default

    Hello again,

    I get the grid data with JSON reader and while getting those information I also get the data's id since I need that for updating records via RowEditor.

    Is there a better way of holding the row id?

    Thanks alot.
    --
    Mehmet ad?rc?

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

    Default

    Yes, use the record (where it already is).

  5. #5
    Sencha User
    Join Date
    Dec 2009
    Posts
    425

    Default

    You don't need to create a separate field for holding the record id.
    Configure your JsonReader as..
    Code:
    reader: new Ext.data.JsonReader({ 
    root: 'Table',
    idProperty: 'id'
    }, record)
    Make sure your select query passes the 'id' column.

    Then, when you select a record, you can get its id by .... record.id

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    And even if you did need a field to hold a value, you are not forced to create a Column to display it. It can just be in the Record unreferenced by any UI.

  7. #7
    Sencha User
    Join Date
    Aug 2010
    Posts
    177

    Default

    Hello,

    Thanks for the answers I will try them at weekend.
    --
    Mehmet ad?rc?

Similar Threads

  1. Column Hide - Works in IE NOT FF! Help!
    By mortymark in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 27 Oct 2008, 10:52 PM
  2. Shrinking of column on repeated hide/show of column
    By snehaltikekar in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 Jul 2008, 3:28 AM
  3. Replies: 4
    Last Post: 27 May 2008, 9:10 PM
  4. I just want to hide a column!
    By zeek in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 11 Apr 2007, 7:25 AM

Posting Permissions

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