Results 1 to 4 of 4

Thread: Help to add a new row to a GridPanel

  1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    36

    Default Help to add a new row to a GridPanel

    Hi,

    I need your help to add a new row to GridPanel when a button is clicked.
    And this row should have a hyperlink in one of the cell.

    Thanks in advance

  2. #2
    Ext User
    Join Date
    Jul 2010
    Posts
    20

    Default

    maybe, some like this:

    Code:
    function(btn, ev) {
            var u = new store.recordType({
                 name: '',
                description : ''
            });
            
            grid.stopEditing();
            store.insert(0, u);
            grid.startEditing(0, 1);
        }

  3. #3
    Sencha User vishalnnsingh's Avatar
    Join Date
    Sep 2010
    Location
    Kolkata, India
    Posts
    115

    Default

    to have a hyperlink just add <a href='vhgvd.html'>Your Hyperlink</a>
    Code:
    var defaultData = {
      name:'jbj',
      description:'jh',
      //your 3rd column
      yourhyperlink:'<a href='vhgvd.html'>Your Hyperlink</a>'
    };
    var u = new store.recordType(defaultData);
    rest has been said in teh above post
    I Meet Challenge with Excitement & My Only Gossip is Love

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

    Default

    Code:
    var rec = new store.recordType({
      field1: 'value1',
      field2: 2,
      field3: 'http://www.google.com'
    });
    store.add(rec);
    and write a renderer for the column of field3 to show the value as a hyperlink, e.g.
    Code:
    renderer: function(v) {
      return '<a href="' + v + '">' + v + '</a>';
    }

Similar Threads

  1. Add and remove a row in gridPanel without error in IE
    By vampyro in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 17 Mar 2010, 5:15 PM
  2. GridPanel add new row at the end of the grid
    By querymaker in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 24 Nov 2009, 10:49 PM
  3. Replies: 11
    Last Post: 22 Apr 2009, 9:39 AM
  4. add a row of data to GridPanel
    By directx32 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 29 Mar 2008, 4:07 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
  •