Jump to content

Solution - UniDBGrid Goto Next Record (Row) after Edit


Sherzod

Recommended Posts

Hi All ... 

 

One of the solutions ... (Can be useful to someone) 

 

After editing the grid, move to the next cell to the next line. 

 

 

1. UniDBGrid1 -> ExtEvents -> 


function edit(editor, context, eOpts)
{   
  ajaxRequest(this, 'modified', []); 
}

2.



procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TStrings);
begin
  if (EventName = 'modified') and
     (UniDBGrid1.DataSource.DataSet.RecNo <> UniDBGrid1.DataSource.DataSet.RecordCount)
  then begin
    if UniDBGrid1.WebOptions.Paged then UniSession.AddJS('if (('+UniDBGrid1.JSName+'.getStore().pageSize - 1) != '+UniDBGrid1.JSName+'.uniRow){'+UniDBGrid1.JSName+'.getSelectionModel().setCurrentPosition({row: '+UniDBGrid1.JSName+'.uniRow + 1, column: '+UniDBGrid1.JSName+'.uniCol})} else {'+UniDBGrid1.JSName+'.getStore().nextPage(1);'+UniDBGrid1.JSName+'.uniRow = 0};')
    else UniSession.AddJS(UniDBGrid1.JSName+'.getSelectionModel().setCurrentPosition({row: '+UniDBGrid1.JSName+'.uniRow + 1, column: '+UniDBGrid1.JSName+'.uniCol});')
  end;
end;


Sincerely...

  • Upvote 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...