Results 1 to 2 of 2

Thread: How To Add ,Delete Rows in grid

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Hyderabad,india
    Posts
    13
    Vote Rating
    1
      0  

    Default How To Add ,Delete Rows in grid

    In My application,Iam Having The AddRow,Delete Row Buttons In Grid How To Add&Delete That Rows, In Grid,

    Iam Using this Code,
    var addrow=Ext.create('lib.Commons.Button', {
    text: 'Add Row',
    cls:'buttonPaddings',
    listeners : {
    click : function(){
    var createnewcontactGridPanel = Ext.getCmp('creategrid');
    alert(creategrid);






    }
    }




    });
    var deleterow=Ext.create('lib.Commons.Button', {
    text: 'Delete Row',
    cls:'buttonPaddings',

    });
    please Give Me The Replay,

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,101
    Answers
    113
    Vote Rating
    100
      0  

    Default

    you have to add/delete records in the store bound to your grid. you cannot perform these actions on the grid. The grid is just the display element; the data is contained in the store.

    Code:
    store.add(record); // adds a record to your store
    store.remove(record); // removes a record from your store
    you can also pass an array instead of a single record to these functions and add or remove multiple records at once.

    To get the selected records for deleting, you can use:

    Code:
    var srecords = grid.getSelectionModel().getSelection();  // returns an array of selected record(s)

Posting Permissions

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