Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Raj on May 21, 2008 08:39
open dhtmlx forum
adding new row and focus should be on new row

Hi,

1) I am adding a new row at end of the grid, I want that row should be selected and shown to the user after creation. The focus should be on newly created row.

2) I am adding a new at the end of the page and deleting the same, after deletion of the row I am getting a javascript error,
Javascript error:
Error: 'this.getRowById(..).style' is null or not an object.
This error is coming in the method:
/**
* @desc: sets row text weight to normal
* @param: row_id - row id
* @type: public
* @topic: 2,6
*/
this.setRowTextNormal = function(row_id){
this.getRowById(row_id).style.fontWeight = "normal";
}

can u please tell me hw to solve the above problems?

/Thanks
Raj
Answer posted by Support on May 21, 2008 09:56

>>I want that row should be selected and shown

var id=some;
grid.addRow(id,values)
grid.selectRow(grid.getRowIndex(id));
grid.showRow(id);

 

>>2) I am adding a new at the end of the page and deleting the same

The problem seems caused by dataprocessor. Please be sure that you are using unique ID for newly added rows ( the problem may occurs in case of not-unique IDs in grid )
If IDs are unique and problem still occurs - please provide code snippet which you are using for dataprocessor initialization.