Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Event handler for ListGrid add/remove records?

$
0
0
I'm creating a CanvasItem whose canvas is a ListGrid. For this purpose, I need to track whenever the ListGrid changes so that I can call storeValue. The callback cellChanged captures most events, but it does not get called when records are added or removed. None of the event handlers I found seemed appropriate.

Do you have a suggestion for how to do this?

I'm using "v9.1p_2015-07-08/Pro Deployment".

Code:

var lg = isc.ListGrid.create({
  autoDraw:true,
  dataSource: isc.DataSource.create({
      clientOnly:true,
      fields:[
        {hidden: true,name: "id",primaryKey: true},
        {name:"a",title:"A",
          changed: function(f,i,v){
            console.log("changed3");
          }
        }
      ],
  }),
  saveLocally:true,
  data:[                                                                                                       
      {id:1,a:"1"},
      {id:2,a:"2"},
      {id:3,a:"3"},
  ],
  canEdit: true,
  editByCell: true,
  canRemoveRecords: true,
  cellChanged : function () {
      console.log("cellChanged",this.data);
  },
  viewStateChanged: function(){
      console.log("vsc");
  },
  fieldStateChanged: function(){
      console.log("fsc");
  }
});

isc.Button.create({
  autoDraw:true,
  title: "New",
  top:100,
  click: function(){
      lg.addData({a:"new"});
  }
});


Viewing all articles
Browse latest Browse all 4756

Trending Articles