KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Events for the Data Grid
PRODUCT: 4D Web 2.0 Pack | VERSION: 1.1 | PLATFORM: Mac & Win
Published On: August 29, 2007

PLEASE NOTE: This Tech Tip applies to 4D Web 2.0 Pack version 1.1

If you are embedding a 4D Ajax Framework (4DAF) Data Grid object into an HTML page, you can catch certain events to specify any actions that you wish. The DataGrid object currently supports two events: "onrowselect" and "onrowdblclick".

To capture the "onrowselect", define an event handling function as follows (in bold):

onAfterInit = function(){
   myDataWindow = new DataWindow('Bookmarks', $('bookmarksDiv'), 'Type', 'URL@');
   myDataWindow.grid.grid.onrowselect = function(rowreference){
      // Do something
   };

};


To capture the onrowdblclick:

onAfterInit = function(){
   myDataWindow = new DataWindow('Bookmarks', $('bookmarksDiv'), 'Type', 'URL@');
   myDataWindow.grid.grid.onrowdblclick = function(rowreference){
      // Do something
   };

};


For the latest information the 4D Ajax Framework please see the Daxipedia:

http://daxipedia.4d.com