Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by javaxmlsoapdev on Apr 28, 2008 08:11
open dhtmlx forum
dhtmlxGrid read data on one click

I am using standard(free) license of this control.

I want to use grid control only for adding new data (rows) as per the use case requirement. For e.g. On page render there will be "Add Item" button which will create new blank row for user to enter data in. User can keep adding more rows clicking on "Add Item" button. There will also be "Remove Item" button which can remove just added data if user wishes to remove particular line item from the grid. Upon clicking final "Submit" button on the page, I need to read all rows from the grid and submit it to one of the the Java class.

can someone guide me how to achieve this?

thanks,
Answer posted by Support on Apr 28, 2008 09:06
You can use next code to access data of all cells

grid.forEachRow(function(id){
    for (var i=0; i<grid.getColumnNum(); i++){
       alert("cell at row "+id+" cell "+i+" == "+grid.cells(id,i).getValue() );
    }
});

The standard edition doesn't contain ready to use transport for sending data to server side, so you can use snippet above to access data and use any custom code to send data to server.