Jump to content

UnidbGrid Editing and paged


UniUser

Recommended Posts

Hello, i have commercial version of Unigui (1.0.0.1394).

 

I have a unidbgrid where i can only modify a quantity field (clickstoedit=1, RowEditor=False)

All works ok but sometimes when i modify the quantity cell on the grid and i change page (without posting the value with enter), the value is not saved in the clientdataset.

If for example i click a button all works ok and the value is saved.

 

How can i force post when change page?

 

Thank for your answer.

 

 

Link to comment
Share on other sites

Hi,

 

Can you try this approach for now ?!:

 

1. UniDBGrid -> ClientEvents -> ExtEvents -> Ext.toolbar.Paging [pagingBar] -> function pagingBar.beforechange:

function pagingBar.beforechange(sender, page, eOpts)
{
    ajaxRequest(sender, '_post', []);
}

2. UniDBGrid -> OnAjaxEvent:

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_post' then
    if (UniDBGrid1.DataSource.DataSet.State in [dsEdit]) then
      UniDBGrid1.DataSource.DataSet.Post;
end;

Best regards,

Link to comment
Share on other sites

Hi,

 

Can you try this approach for now ?!:

 

1. UniDBGrid -> ClientEvents -> ExtEvents -> Ext.toolbar.Paging [pagingBar] -> function pagingBar.beforechange:

function pagingBar.beforechange(sender, page, eOpts)
{
    ajaxRequest(sender, '_post', []);
}

2. UniDBGrid -> OnAjaxEvent:

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_post' then
    if (UniDBGrid1.DataSource.DataSet.State in [dsEdit]) then
      UniDBGrid1.DataSource.DataSet.Post;
end;

Best regards,

 

Hello, it seems to work good.

Thank you for your support.

Best regards,

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...