Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by UdhayabalaChandar.C on May 06, 2008 09:32
open dhtmlx forum
Add empty row when Click in Cell or in Cell focus

I have 52 rows with Data and 53 row with empty columns....


Suppose I edit the 53th row and click the enter key..

54th row is should be created with empty columns and Hidden coloumns also

How can we do in the DHTML grid.
Please suggest some solutions.


Thanks and Regards
Udhayabalachandar.C
Answer posted by Support on May 07, 2008 02:03
>>Please suggest some solutions.
You can use code similar to next
   
mygrid.attachEvent("onEnter",function(id,ind){
    if (this.getRowsNum() == (this.getRowIndex(id)+1))
       mygrid.addRow(mygrid.getUID(),[],-1);
    return true;
})

As result, pressing of enter key in last row will cause adding of new row.
Answer posted by Udhaya Bala Chandar on May 08, 2008 03:18

Hi dude..

 Using Your Script I created Empty Rows. And Enter cell values. Simillarly I created 5 rows and Enter the values in the 5 Rows and Click Save Button

only one record is saved and Script Error is occured

This is the Save method Which I call for Save

function save(){
    myDataProcessor.setOnAfterUpdate(function(){
       if (myDataProcessor.getSyncState()) after_save();
    });
    myDataProcessor.sendData()
};

function after_save(){
    mygrid.clearAll(true);
    mygrid.loadXML("sms/update.jsp?action=get_data",function(){
     mygrid.setColumnHidden(2,true);
     mygrid.setColumnHidden(3,true);
     mygrid.setColumnHidden(4,true);
     });
};

 

 

Answer posted by Support on May 14, 2008 10:25
Please check the response generated by server side code, it must be correct XML with correct sid and tid values
To check details of server side response you can use
    myDataProcessor.enableDebug(true)